当前位置: > 谁知道 Cells(c,1).value = i这个命令是中文描述是什么,啥意思?...
题目
谁知道 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

提问时间:2020-07-26

答案
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
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.