View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Anne Troy[_2_] Anne Troy[_2_] is offline
external usenet poster
 
Posts: 221
Default running private sub

Private subs are run on the event. For instance, Private Sub
Worksheet_Activate() will run when the worksheet is activated. Private Sub
Workbook_Open() runs when the workbook is open. You can find all events like
this by going into the Visual Basic Editor and getting the code window at
right. Hit the dropdown and choose Workbook, then choose the right-hand
dropdown and choose one of the events. Then double-click one of the sheet
tabs, and do the same. You'll see all the different events there, and it
auto-creates the macro names for you so you can tell what they are.

Hope this helps!
*******************
~Anne Troy

www.OfficeArticles.com


"Gary Keramidas" wrote in message
...
there has to be a simple answer. i see all these references to private

sub,
how do you run the code?


private sub worksheet_test(this is a test)
code here

end sub

i have no idea how to call this, can someone explain?


thanks

--


Gary