#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Message Box

Hi,

Is it possible to write a VBA on excel that when I click over a specific
worksheet's tab a message box pop-up and give me a message?

Thanks in advance


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Message Box

Put code like the following in the ThisWorkbook code module.

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "Sheet1" Then
MsgBox "Hello world"
End If
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"A-Design" wrote in message
...
Hi,

Is it possible to write a VBA on excel that when I click over a
specific worksheet's tab a message box pop-up and give me a
message?

Thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Message Box

Thank you so much,

Should I paste it to ThisWorkbook or just the sheet that I need to use the
code on?
The message box,is it possible that I can change the color of the box or
message?

Thanks again.

"Chip Pearson" wrote in message
...
Put code like the following in the ThisWorkbook code module.

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "Sheet1" Then
MsgBox "Hello world"
End If
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"A-Design" wrote in message
...
Hi,

Is it possible to write a VBA on excel that when I click over a specific
worksheet's tab a message box pop-up and give me a message?

Thanks in advance





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Message Box

Put the code in the ThisWorkbook code module. No, you can't
change the colors of a msgbox.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"A-Design" wrote in message
...
Thank you so much,

Should I paste it to ThisWorkbook or just the sheet that I need
to use the code on?
The message box,is it possible that I can change the color of
the box or message?

Thanks again.

"Chip Pearson" wrote in message
...
Put code like the following in the ThisWorkbook code module.

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "Sheet1" Then
MsgBox "Hello world"
End If
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"A-Design" wrote in message
...
Hi,

Is it possible to write a VBA on excel that when I click over
a specific worksheet's tab a message box pop-up and give me a
message?

Thanks in advance







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Message JG Excel Worksheet Functions 3 December 28th 06 02:51 PM
If then Message Box Nikki Excel Discussion (Misc queries) 8 December 22nd 05 02:41 PM
changing the message in an error message The Villages DA Excel Worksheet Functions 2 February 18th 05 05:30 PM
Message Pop Up Box [email protected] Excel Programming 1 January 24th 05 09:19 PM
Displaying a message in a message box without requiring user to click anything to proceed Android[_2_] Excel Programming 2 June 25th 04 06:44 PM


All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"