![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
|
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 |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
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 ] |
|
|
|
|
|
#4 |
|
Guest
Posts: n/a
|
yeah great!
of course. thanks guys. remi |
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|