Solved

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

Posted on 2013-11-14
2
381 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 34

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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

691 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