[英]How do I select a range of cells depending on number of rows in the sheet?
I currently have multiple data sheets with information in columns AI in all of them, and I want to select a range of cells in each. 我目前有多个数据表,所有数据表的AI列中都有信息,我想在每个数据表中选择一个单元格范围。 Column A varies between 150 rows to 450 rows of data depending on the sheet.
列A在150行到450行数据之间变化,具体取决于工作表。 I want to select columns AI but only up through the last row found in column A. I used the last row function:
我想选择AI列,但只选择A列中的最后一行。我使用了last行功能:
LastRow = Range("A65536").End(xlUp).Row
How do I get the macro to select columns AI up through the last row? 如何获取宏以选择AI到最后一行? I want it to function as if it was written:
我希望它的功能就像写的一样:
Range("A1:ILastRow").Select
where the "LastRow" is the number of the last column. 其中“ LastRow”是最后一列的编号。
Thanks, James 谢谢,詹姆斯
... You're EXTREMELY close - just use this: ...您非常接近-只需使用以下命令:
LastRow = Range("A65536").End(xlUp).Row
Range("A1:I" & LastRow).Select
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.