How do you select the entire excel sheet with Range using VBA?

前端 未结 11 765
萌比男神i
萌比男神i 2021-02-01 16:37

I found a similar solution to this question in c# How to Select all the cells in a worksheet in Excel.Range object of c#?

What is the process to do this in VBA?

11条回答
  •  我在风中等你
    2021-02-01 17:06

    You can simply use cells.select to select all cells in the worksheet. You can get a valid address by saying Range(Cells.Address).

    If you want to find the last Used Range where you have made some formatting change or entered a value in you can call ActiveSheet.UsedRange and select it from there. Hope that helps

提交回复
热议问题