谁知道 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
人气:204 ℃ 时间: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
推荐
猜你喜欢
- The ice is very thin.You can't play on it.改为同义句
- NBA篮球决赛门票价格是:一等席300美元,二等席200美元,三等席100美元,某商场在促销活动中,组织特等奖和一等奖的36名顾客去看NBA篮球的决赛,出去其他费用后,计划购买这两种门票,用完5052美元,你能提供几种购票方案给商场选择?并
- 一根长1米的钢管,内直接1分米,外直径6分米,每立方厘米钢的质量为7.8克,这根钢管的质量约是多少千克
- 15.在2×3的矩形方格纸上,各小正方形的顶点成为格点,则以格点为顶点的等腰直角三角形有 A.24个 B
- 范进中举句子赏析
- 1除以5等于0.2,怎么1除以5等于0余1呢?
- DO you like Chinese Yes,I do.But only a ( )
- 英语作文 关于成功的理解