Solved

MS Excel Position cursor in Cell C2 in all sheets in a workbook

Posted on 2013-11-14
2
347 Views
Last Modified: 2013-11-14
I am looking for a macro that would place the cursor in Cell C2 of all sheets of a workbook when the file is opened -- regardless of where the cursor was at the time of save. I also need the first sheet of the workbook to be in focus when the file is opened. I currently have the following code running for "all worksheets"; however, when the file is opened, the last sheet is in focus (instead of the first). Any help is greatly appreciated!

Private Sub Workbook_Open()
Dim WSheet As Worksheet

For Each WSheet In Worksheets
WSheet.Activate
Range("C2").Select
Next
End Sub
0
Comment
Question by:jaguar5554
2 Comments
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 39648796
Try this.
Private Sub Workbook_Open()
Dim I As Long

    For I = Worksheets.Count To 1 Step -1
        Application.Goto WorkSheets(I).Range("C2"), Scroll:=True
    Next I

End Sub 

Open in new window

0
 

Author Comment

by:jaguar5554
ID: 39648808
That is perfect.  Thank you very much.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

914 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

18 Experts available now in Live!

Get 1:1 Help Now