macro code for select all

kylefoley76

Well-known Member
Joined
Mar 1, 2010
Messages
1,553
i record macro and hit select all and that action won't record. what's the macro code for select all in excel. i assumed it was the same as word

selection.wholestory

but it's not
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Select all what?

All the cells in a worksheet?
Code:
Cells.Select
 
Upvote 0
Uhhh, why bother selecting? It's generally unnessary. What else are you trying to do other than select the whole sheet?
 
Upvote 0
Personally I need to use select all FILLED cells in Macros as I copy data between tabs and the destination area is surrounded by other formulas.

So I use this:

Rich (BB code):
ActiveSheet.UsedRange.Select
 
Upvote 0
But you could use, for instance
So select isn't necessary
Code:
ActiveSheet.UsedRange copy destination:=Sheets("Sheet2").range("A1")
 
Upvote 0
Welcome to the Board!

Personally I need to use select all FILLED cells in Macros as I copy data between tabs and the destination area is surrounded by other formulas.

So I use this:

Rich (BB code):
ActiveSheet.UsedRange.Select

You might want to look at SpecialCells. ;)
 
Upvote 0

Forum statistics

Threads
1,224,502
Messages
6,179,126
Members
452,890
Latest member
Nikhil Ramesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top