PDA

View Full Version : Solved: Macro to go to first worksheet in any workbook



macro_man
02-15-2011, 08:57 AM
This should be easy but I cannot locate a macro command to do this:

I need a macro command to do the following:

Go to the first worksheet in any active workbook.

This will be saved in my personal.xlsm so it can be applied to any spreadsheet that is open and active.

I do not want to create a Sheet1 in every workbook so that the command Sheets("Sheet1").Select is to be used as every workbook is different with a different number of worksheets (not every workbook has a Sheet1 worksheet).

Repeating ActiveSheet.Previous.Select will not work as it will abend if the number of selections in the macro exceed the number of worksheets in the workbook.

Thanks for any assistance.

Allen

Bob Phillips
02-15-2011, 08:58 AM
Activeworkbook.Worksheets(1).Activate

macro_man
02-15-2011, 09:10 AM
Activeworkbook.Worksheets(1).Activate



Thank you very much!