谁知道 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
人气:478 ℃ 时间: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
推荐
猜你喜欢
- ------,dolphins have no sense of smell.
- 第九课自然之道,眼前的一幕指的是什么
- 若x=1,y=-2,是关于x、y的方程ax-by=1的一个解,且a+b=-4,则3a-4b=?
- 减速机速比如何计算
- 已知实数x,y,满足x-√x-1=√y+3-y,则x+y最大值是?
- be devoted to ,be dedicated to ,be absorbed in有什么区别?
- 用for循环语句编程,写出,0到100之间能被3整除的个数
- To the one whom in my deep heart