View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Otto Moehrbach[_4_] Otto Moehrbach[_4_] is offline
external usenet poster
 
Posts: 9
Default How does "Private" work

Bob
Thanks for your help and thanks for taking the time to explain it to me.
Otto
"Bob Phillips" wrote in message
...
Otto,

These two modules are in different code modules, one in a sheet code

module,
the other in (I presume) a normal code module. You cannot invoke Private
procedures across different modules.

If you include an 'Option Private Module' in the code module, those
procedures will not show in the macro list, but will still be available to
other modules in that project. The one thing you won't be able to do is to
invoke them from another project (workbook).

--

HTH

Bob Phillips

"Otto Moehrbach" wrote in message
...
Excel 2002, Win XP
I have a sheet macro:
Private Sub Worksheet_Activate()
Call UpdateSummary
End Sub

The UpdateSummary macro looks like this:
Private Sub UpdateSummary()
'Stuff
End Sub

Upon activation of the sheet, I get an error message on the "Call
UpdateSummary" line that it is not defined. If I remove the word

"Private"
before the Sub UpdateSummary() all works fine. I wanted to ensure that

the
UpdateSummary macro was not displayed in the Tools - Macro - Macros

list,
so
I put the "Private".
Obviously there is something here that I don't know. What is it?
Thanks for your help. Otto