谁知道 Cells(c,1).value = i这个命令是中文描述是什么,啥意思?
原程序是:
Sub DoIt()
c = 0
For i = 1 To 9
For j = i + 1 To 10
For k = j + 1 To 11
If 2 * j i + k Then
c = c + 1
Cells(c,1).value = i
Cells(c,2).value = j
Cells(c,3).value = k
End If
Next k
Next j
Next i
End Sub
人气:363 ℃ 时间:2020-02-05 07:40:14
解答
Cells是Excel对象Worksheet的属性,您可以如下例利用Cells属性对单元格赋值:
Private Sub Command1_Click()
Dim xl As Excel.Application
Set xl = New Excel.Application
xl.Visible = True 'make the excel application visible
xl.Workbooks.Add
xl.ActiveWorkbook.Worksheets("Sheet1").Cells(1,1).Value = "hello"
xl.ActiveWorkbook.SaveAs ("d:\book1.xls")
xl.Quit
Set xl = Nothing
End Sub
推荐
猜你喜欢
- 一个圆柱体和一个圆锥体等底等高,他们的体积相差24平方厘米,圆柱的体积是多少立
- 甲乙两个自然数的最大公约数比它们的最小公倍数小570并且甲数与乙数的比是5:4甲数是多少?
- 如果1!=1 =1×2 =1×2×3 …… 1×2×3 ×98×99×100=100!,那么1!+2!+3!+…+100!的个位数字
- if it is not carried out in the money world,there is something less real about it.
- 望远镜看演出时,不小心把望远镜拿反了,将物镜和目镜对调了,他发现,远处的物体不仅没有放大,反而变小了,这是为什么呢?
- 女孩儿微笑 用英文正确表达出来
- Let me to help you find your parents for you(改错)
- 知道 加速度的定义是是啥嘛?是 △V/△t 那加速度等于F比M是什么式