我想选择整个Excel工作表中的CC#的 Excel.Range
对象将自动调整,边框等我有表内的一些合并单元格
I am trying to select the whole excel sheet in the Excel.Range
object of cC# for applying auto fit, border etc. I have some merged cells within the sheets.
有没有什么简单的一招这样做呢?
Is there any simple trick to do so?
从此处拍摄,这将选择所有单元格在工作表中:
Taken from here, this will select all cells in the worksheet:
lastCol = ActiveSheet.Range("a1").End(xlToRight).Column
lastRow = ActiveSheet.Cells(65536, lastCol).End(xlUp).Row
ActiveSheet.Range("a1", ActiveSheet.Cells(lastRow, lastCol)).Select