?
Solved

vba activate

Posted on 2013-06-20
5
Medium Priority
?
676 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 2000 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

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

755 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