Solved

vba activate

Posted on 2013-06-20
5
567 Views
Last Modified: 2013-06-20
Hello

 VBA Issue
There are multiple sheets in a workbook. There are multiple workbooks in a folder.
While iterating through each workbook, do this >>
Activate the first worksheet which is also visible and then save the workbook.
Reason – several of the workbooks I open , are showing the last sheet as activated when I open them.
0
Comment
Question by:Rayne
  • 3
  • 2
5 Comments
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 39263892
What is the issue?

Kevin
0
 

Author Comment

by:Rayne
ID: 39263994
Hello Kevin,

I have multiple files in a folder. Each file has zillions of tabs. And I see that when I open each file, the last tab opens up in most of the files. So I would rather prefer when I open each file, that the first visible tab appears, not the last one? Get it?
0
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 39264020
Yes.

Before saving the workbook, execute this line:

    TargetWorkbook.Sheets(1).Activate

Kevin
0
 

Author Closing Comment

by:Rayne
ID: 39264053
Thanks Kevin
0
 

Author Comment

by:Rayne
ID: 39264111
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel 2013 Issues 11 42
Checkout file from sharepoint server with password 2 39
MS Excel Formula Help 3 32
Excel formula - data format 5 17
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

809 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