excel vba最后一行variables不计算
我正在使用的线:
Dim lastrowmonth as Integer, PMARow As Integer lastRowMonth = Cells(1 & "," & Rows.Count).End(xlUp).Row Do While PMARow < lastRowMonth + 1
然而,它不断告诉我, lastRowMonth = 1
,因此不会让我访问我的代码,在do while
。 这里有任何build议,因为A列中有1400个填充单元格,理想情况下,我想继续将1
更改为variables以移动其他列。
任何帮助将是伟大的!
尝试这个:
lastRowMonth = Cells(Rows.Count,1).End(xlUp).Row
也许这是一个好主意,宣布lastRowMonth
作为一个Long
,因为在Excel中有更多的行比Integer
可以采取
您需要将第二行更改为:
lastRowMonth = Cells(Rows.Count, 1).End(xlUp).Row