• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 556
  • Last Modified:

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
0
darls15
Asked:
darls15
2 Solutions
 
Saqib Husain, SyedEngineerCommented:
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)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

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now