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 / January 2006

Tip: Looking for answers? Try searching our database.

How call procedure when worksheet opened?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 23 Jan 2006 00:01 GMT
The following macro call works fine when a specific cell is updated. How do I
call the macro when the worksheet is first opened?

Private Sub Worksheet_Activate(ByVal Target As Excel.Range)
   If Target.Address = Range("hanwono").AddressLocal Then Call
PullExistingDataToHand
End Sub
Tom Ogilvy - 23 Jan 2006 00:07 GMT
In the ThisWorkbook module

Private Sub Workbook_Open()
  ' any conditions you might want
  PullExistingDataToHand
End Sub

See Chip Pearson's page on Events
http://www.cpearson.com/excel/events.htm

Signature

Regards,
Tom Ogilvy

> The following macro call works fine when a specific cell is updated. How do I
> call the macro when the worksheet is first opened?
[quoted text clipped - 3 lines]
> PullExistingDataToHand
> End Sub
John - 23 Jan 2006 00:47 GMT
Tim, I'm pretty new at this VBA stuff, but I think this is almost all I need.
What condition to I check to be sure I'm on the "Hand" sheet to call this
procedure?

> In the ThisWorkbook module
>
[quoted text clipped - 14 lines]
> > PullExistingDataToHand
> > End Sub
Tom Ogilvy - 23 Jan 2006 01:13 GMT
Private Sub Workbook_Open()
  If lcase(ThisWorkbook.Activesheet.Name) = "hand" then
  PullExistingDataToHand
  End if
End Sub

If you only want it to run when you open workbook and the default sheet is
named "Hand"

Signature

Regards,
Tom Ogilvy

> Tim, I'm pretty new at this VBA stuff, but I think this is almost all I need.
> What condition to I check to be sure I'm on the "Hand" sheet to call this
[quoted text clipped - 18 lines]
> > > PullExistingDataToHand
> > > End Sub
Bob Phillips - 23 Jan 2006 00:12 GMT
Use the Workbook_Open event, not Activate

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

> The following macro call works fine when a specific cell is updated. How do I
> call the macro when the worksheet is first opened?
[quoted text clipped - 3 lines]
> PullExistingDataToHand
> End Sub
 
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.