Launch MsgBox upon opening a specific sheet?

doug1022

New Member
Joined
Nov 21, 2005
Messages
5
Hello,

I am new to the world of vba and was hoping an experienced user could help me out with what is likely a simple question.

How do I initiate a message box ("Please update earnings consensus") each time a specific worksheet within a file is selected?

If I am working on this file all day, I want to be reminded each time I select this worksheet. Any ideas?

Many Thanks
Doug
 

Some videos you may like

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,047
Office Version
  1. 365
Platform
  1. Windows
Try this.

To put the code in right click on the worksheet tab and select View Code.
Code:
Private Sub Worksheet_Activate()
    MsgBox "Please update earnings consensus"
End Sub
 

doug1022

New Member
Joined
Nov 21, 2005
Messages
5
Thanks very much for the quick reply.

This works perfectly.

I appreciate the help!
 

Watch MrExcel Video

Forum statistics

Threads
1,118,048
Messages
5,569,871
Members
412,298
Latest member
dietitiann
Top