Solved

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

Posted on 2013-11-14
2
338 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
Comment Utility
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
Comment Utility
That is perfect.  Thank you very much.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
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…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

743 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

17 Experts available now in Live!

Get 1:1 Help Now