How to activate a specific sheet in an Excel file?

Advanced Macro Recorder/Editor.

Moderator: Pulover

User avatar
Muhammadi
Posts: 36
Joined: 27 May 2021, 20:00

How to activate a specific sheet in an Excel file?

21 Jun 2021, 20:00

Hi,
Does anyone know how to activate a specific sheet of an Excel file in PMC?

This script activates the Excel file:
WinActivate, File's name - Excel ahk_class XLMAIN

I need a similar thing but for a specific sheet in the excel file.

Thanks,
Muhammadi
aifritz
Posts: 301
Joined: 29 Jul 2018, 11:30
Location: Germany

Re: How to activate a specific sheet in an Excel file?

27 Jun 2021, 12:40

I'm not working with PMC, but there are many examples already in the forum.
With ahk and a bit knowledge of VBA you nearly could automate everything.

here a simple example...

Code: Select all

xl:=ComObjActive("Excel.Application")
xl.Sheets(2).Activate ;activates sheet 2 of the current spreadsheet



Return to “Pulovers Macro Creator”

Who is online

Users browsing this forum: No registered users and 22 guests