Solved

View Messagebox in Excel

Posted on 2003-11-10
3
198 Views
Last Modified: 2010-05-03
I have an Excel workbook that has several worksheets.  I would like to have a Textbox of some sort pop up and alert the user that they need to review the information that is typed on that spreadsheet.


So basically, my question is: how do I get a popup box to pop up when the user click on a particular worksheet's tab.  I'm new to VB so please bear with me.

Thanks in advance for your help!!!
Sean
0
Comment
Question by:eeboater
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
mgroyal earned 90 total points
ID: 9718972
Just open the vb-editor in excel and put this code in it...

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    MsgBox ("this is my message")
End Sub

Cheers *mg
0
 

Author Comment

by:eeboater
ID: 9723610
That worked great!!  Just curious, that message box appeared when all the worksheets were selected.  How can I tweak that code so that it only appears when one particular worksheet is selected.

For example, i have 4 tabs, names, addresses, phones and dates.  I want the message to appear when I select the Addresses tab/worksheet. And not have the message appear when all other tabs/worksheets are selected.

Thanks again!!!
Sean
0
 

Author Comment

by:eeboater
ID: 9723740
I figured it out, I just put an IF statement identifying the worksheet.  If the proper worksheet is there, then it displays the message.

Thanks,
Sean
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question