下面是我的資料的副本。我一直試圖找到最后一列 1(所以在這個例子中,它應該是4,因為最后一列是C和加1)。我使用的代碼是用來確定最后一列的:
但是我一直得到2? uj5u.com熱心網友回復: 結果將是3。
結果將是3(第5行的最后一列) 結果將是2(第10行的最后一列) uj5u.com熱心網友回復: 正在使用lastrow,在該行中,只有兩列被填充。用標題行來代替。
標籤:lastColumn
lastColumn = Cells(lastRow, Columns.Count).End(xlToLeft).Column lastColumn = Cells(5, Columns.Count).End(xlToLeft).ColumnlastColumn = Cells(lastRow, Columns.Count).End(xlToLeft).ColumnlastColumn = Cells(**5**, Columns.Count).End(xlToLeft) 。

