How to Set the Active Sheet

Post Reply
TheArtfulDodger
Posts: 14
Joined: Fri Jun 20, 2014 3:25 pm

How to Set the Active Sheet

Post by TheArtfulDodger »

Hello:
This is likely to be a very simple question to answer but I have searched through the BM Manual and, for the life of me, I cannot find out how to set the active sheet (or change it) once I have opened a spreadsheet file with multiple sheets.
Your assistance is much appreciated!

Sparky
SuperTech
SoftMaker Team
SoftMaker Team
Posts: 3187
Joined: Wed Mar 11, 2020 5:31 pm

Re: How to Set the Active Sheet

Post by SuperTech »

Yes, please check the below code, which will open sheet number 4:

Code: Select all

sub main
	' PlanMaker starten
	Set pm = CreateObject("PlanMaker.Application")

	pm.Visible = True
	pm.Activate

	pm.activeWorkbook.Sheets(4).activate
end sub
Instead of passing sheet number, you can also pass sheet's name like this:

Code: Select all

pm.activeWorkbook.Sheets("test").activate
Post Reply

Return to “BasicMaker 2021 for Windows”