Return a range from A1 to the true last used cell

后端 未结 4 740
名媛妹妹
名媛妹妹 2020-11-27 05:48

I\'d like to select all the rows and columns in a spreadsheet. The macro needs to be dynamic, as the number of columns and rows tend to vary each time the macro would be cal

4条回答
  •  独厮守ぢ
    2020-11-27 06:17

    @brettdj pointed out the use of ActiveSheet.UsedRange to clear the current used range. I would use the simple code below.

    ActiveSheet.UsedRange
    ActiveSheet.UsedRange.Select
    

提交回复
热议问题