[howto] user opens excel sheet and gets my message

G

Guest

Guest
hi,

I`m building a macro and I want to start by telling the user of the sheet that there is a macro in the sheet doing "this and that".

how do I get this done?
I know the MsgBox command but I can`t seem to get it to work right after the "enable macro button" is chosen by the sheet user.

Anyone who can help me on the way a little bit?

Thnk.
Remi
Holland
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi

Copy this snippet of code then right click your sheet tab and select View Code. Paste it in the large white area. Use Alt+F11 to return to your sheet. Gives message whenever sheet is activated.
If your users get tired to reading it, they can switch it off by typing "OFF" in cell A1.
Modify the message to suit your purposes.

Private Sub Worksheet_Activate()
If Range("A1").Value <> "OFF" Then MsgBox "Hi there! This sheet has a neat little macro button that....."
End Sub

Hope this helps
Derek
 
Upvote 0
Put your MsgBox code in the Workbook_Open sub. To get there, open up the VB editor, right-click on the 'ThisWorkbook' entry in the Project Explorer and select 'View Code'. Left-click on the first drop-down and change it from 'General' to 'Workbook'. This will create the Workbook_Open() sub for you. Put your MsgBox code in there. Now, whenever someone opens the Workbook your message will appear.

Edit- Heh, or use Derek's solution, sound much better :)
This message was edited by Mudface on 2002-02-22 02:31
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,140
Members
448,551
Latest member
Sienna de Souza

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top