作者:乔山办公网日期:
返回目录:excel表格制作
cells(i,j).value
i为行号,j为列号。
如,zd需要从A1到B10填写递增的数据,可以如下内代码:
Sub test()
Dim i As Integer, j As Integer
For i = 1 To 10 '第1行到第10行
For j = 1 To 2 '第1列到第2列
Sheets("sheet1").Cells(i, j).Value = i * 10 + j 'sheet1为需要处理的容表名
Next j
Next i
End Sub
不想去看23对应字母,如下也能得到结果。
range("A65536").offset(0,22).end(xlup).row
A列最后一行
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
B列最后一行
LastRow = Cells(Rows.Count, 2).End(xlUp).Row
A列最后一行
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
B列最后一行
LastRow = Cells(Rows.Count, 2).End(xlUp).Row