Solved

View Messagebox in Excel

Posted on 2003-11-10
3
196 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

776 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