?
Solved

vba activate

Posted on 2013-06-20
5
Medium Priority
?
629 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 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 Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

766 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