Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Sheet view VBA


Is there a way to set sheet view using VBA code?



Did you see my Answer below? Seems that the email alerts stopped working (following a site update) so you may have missed it.
John_Ru (rep: 3222) May 6, '22 at 12:32 pm
Thank You John_Ru, this works just fine with several users at the same time.
Bjotr (rep: 2) May 9, '22 at 5:37 am
Glad it worked for you, Bjotr. Thanks for selecting my answer. 
John_Ru (rep: 3222) May 9, '22 at 8:47 am
Add to Discussion


Selected Answer

Hi Bjotr

If you had a shared workbook with a sheet called "MyResults" say, and created a view called "Meeting view" for that, VBA could display that sheet view with this code (within a standard module sub) :

With Worksheets("MyResults")
    .NamedSheetViews.GetItem("Meeting View").Activate
End With

You can change the bits in bold above to suit your file.

Hope this helps.


Answer the Question

You must create an account to use the forum. Create an Account or Login