• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 792
  • Last Modified:

vba activate

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
Rayne
Asked:
Rayne
  • 3
  • 2
1 Solution
 
zorvek (Kevin Jones)ConsultantCommented:
What is the issue?

Kevin
0
 
RayneAuthor Commented:
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
 
zorvek (Kevin Jones)ConsultantCommented:
Yes.

Before saving the workbook, execute this line:

    TargetWorkbook.Sheets(1).Activate

Kevin
0
 
RayneAuthor Commented:
Thanks Kevin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now