colname = Split(Cells(, i).Address, "$")(1)
Lastrow = .Cells(.Rows.Count, colname).End(xlUp).Row
ws.("?" & Lastrow).Copy ws1.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
i 是一个数字,转换为列名。我需要一个从4号开始的范围,例如,如果i = 1,我需要范围(" A4"& Lastrow)。我有拉斯特罗,我可以得到A,但我怎么做到A4
答案 0 :(得分:1)
Dim ws as Worksheet
Dim Row as integer
Dim Col as integer
Row = 4
Col = 1
Range(Cells(Row, Col), cells(LastRow, Col))
ws.Range(Cells(Row, Col), Cells(LastRow, Col))