Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Run macro when worksheet is opened

I'm trying to get a macro (named Refresh) to run whenever a worksheet is
opened. I've tried using
Private Sub Worksheet_Activate()
Refresh
End Sub

as was suggested in other posts, but this doesn't seem to work.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 221
Default Run macro when worksheet is opened

And this macro is placed in the worksheet? In other words, right-click the
worksheet tab and hit View--Code, and you can see it there? Also, what is
it you're trying to refresh?

*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com


"MLT" wrote in message
...
I'm trying to get a macro (named Refresh) to run whenever a worksheet is
opened. I've tried using
Private Sub Worksheet_Activate()
Refresh
End Sub

as was suggested in other posts, but this doesn't seem to work.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Run macro when worksheet is opened

The macro is in the worksheet. It runs a query that pulls in data from an
Access database. The macro itself works fine if I run it manually.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Run macro when worksheet is opened

Nevermind, I figured it out. Since this was the only worksheet, I should
have used Workbook_Open() instead of Worksheet_Activate().
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protect Excel Worksheet to be opened on one PC only Fabian Excel Discussion (Misc queries) 12 June 27th 20 11:44 PM
Go to cell with maximum value when worksheet opened pignick Excel Discussion (Misc queries) 6 July 17th 08 06:58 PM
how to get a cell to only update when worksheet is opened? Steve P.[_2_] Excel Discussion (Misc queries) 1 December 7th 07 02:29 PM
Add-In will not allow worksheet to be opened. Chad Excel Programming 1 April 7th 05 02:51 PM
Sql query on a range in the opened worksheet Shaul Bel Excel Programming 1 December 31st 03 04:31 PM


All times are GMT +1. The time now is 02:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"