Solved

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

Posted on 2013-05-15
3
494 Views
Last Modified: 2013-05-15
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
Comment
Question by:darls15
3 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 125 total points
ID: 39169851
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
 
LVL 50

Assisted Solution

by:teylyn
teylyn earned 125 total points
ID: 39169855
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
 

Author Closing Comment

by:darls15
ID: 39169876
Thanks for your quick responses. Both solutions work well.

Thanks
darls15
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
This article will show you how to use shortcut menus in the Access run-time environment.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now