Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Start a macro when click on tab sheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nancy - 28 Sep 2007 23:47 GMT
Hi,


When I click on a tabsheet to open a sheet I would like that automaticly
u=one macro start to update this sheet.
It is possible?
Thank you in advance

Nancy
Mike - 29 Sep 2007 00:06 GMT
Paste this into the worksheet module
Private Sub Worksheet_Activate()
   MsgBox "start to update this sheet"
End Sub

> Hi,
>
[quoted text clipped - 5 lines]
>
> Nancy
Jean - 29 Sep 2007 04:40 GMT
> Paste this into the worksheet module
> Private Sub Worksheet_Activate()
[quoted text clipped - 10 lines]
>>
>> Nancy

I try it but nothing happens!

Nancy
Gary Keramidas - 29 Sep 2007 04:51 GMT
put the code on the sheet that is activated when you click the tab,
for example, if you want the code to fire when you click on sheet2
then in the vb editor, double click sheet2 under ms excel objects and paste his
code there.

Private Sub Worksheet_Activate()
   MsgBox "start to update this sheet"
End Sub

Signature

Gary

>> Paste this into the worksheet module
>> Private Sub Worksheet_Activate()
[quoted text clipped - 13 lines]
>
> Nancy
Gord Dibben - 29 Sep 2007 04:56 GMT
Jean

Where did you place the code?

Right-click on the sheet tab and "View Code"

Copy/paste the code into that sheet module.

Switch to another sheet then back to first sheet to "Activate" the code.

Gord Dibben  MS Excel MVP

>> Paste this into the worksheet module
>> Private Sub Worksheet_Activate()
[quoted text clipped - 14 lines]
>
>Nancy
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.