Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-28-2022, 06:59 AM
Marcia's Avatar
Marcia Marcia is offline Message Box vba when a sheet is activated Windows 11 Message Box vba when a sheet is activated Office 2021
Expert
Message Box vba when a sheet is activated
 
Join Date: May 2018
Location: Philippines
Posts: 527
Marcia has a spectacular aura aboutMarcia has a spectacular aura aboutMarcia has a spectacular aura about
Default Message Box vba when a sheet is activated

Hi. I copied this code from Ablebits that gives me the right message when Sheet X is selected. How do I add to the code that if Sheet X or Y or Z is selected, the same message box pops up?


Code:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    On Error Resume Next
    If Sh.Name = "Sheet X" Then
        MsgBox "Print Form 2307", vbInformation, "Print 2307 Message"
    End If
End Sub
Thank you.

Last edited by Marcia; 09-28-2022 at 03:33 PM. Reason: typo
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove MS 365 that was not activated? junkcarp Office 3 04-29-2022 11:01 AM
This copy of MS Office not activated chzuck Office 1 10-10-2021 03:10 PM
Is my Office 'activated' or not? mabel Office 6 08-01-2019 04:18 AM
ActiveX is not activated when opening Excel2016 sheet Pierrot Excel Programming 0 10-28-2016 03:33 AM
Hyperlink not activated by footpedal Donone PowerPoint 2 05-05-2014 04:42 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft