Solved

vba activate

Posted on 2013-06-20
5
604 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
[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
  • 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

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

726 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