Solved

View Messagebox in Excel

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Window placement 17 65
VBA saving file message display 5 47
Using "ScreenUpdating" 6 45
Hide vba in gp 7 48
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now