Select Cell A1 in all worksheets of a workbook when it opens

Hi Experts

I have done some searching but can't seem to find how to do this successfully.

Can someone please help me with how to automatically have Cell A1 (for example) selected for each sheet within a particular workbook when it opens?

Thanks
darls15
darls15Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Saqib Husain, SyedConnect With a Mentor EngineerCommented:
Try putting this in the workbook_open event handler of the workbook module (I have not tested it)

dim aws as worksheet
dim ws as worksheet
set aws = activesheet
for each ws in activeworkbook.worksheets
ws.activate
ws.range("A1").select
next ws
aws.activate
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Connect With a Mentor Microsoft MVP ExcelCommented:
Hello,

You can add this code to each sheet module:

Option Explicit

Private Sub Worksheet_Activate()
 Range("A1").Select
End Sub

Open in new window


Right-click the sheet tab, select "View code" and paste the code into the big code panel.

cheers, teylyn
0
 
darls15Author Commented:
Thanks for your quick responses. Both solutions work well.

Thanks
darls15
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.