View Single Post
  #2   Report Post  
Hank Scorpio
 
Posts: n/a
Default

On Sat, 8 Jan 2005 02:49:05 -0800, yigalb
wrote:

Can someone give me an example how to pass a workshhet name as a parameter
into a subroutine ?
I want to do same thing into different worksheets.


One example:


Sub CallingProcedure()

'If you know the name of the sheet
CalledProcedure "Sheet2"

'Or if you just want the action on the current sheet
CalledProcedure ActiveSheet.Name

End Sub



Sub CalledProcedure(SheetToActOn As String)

'Put the time into cell A1
Worksheets(SheetToActOn).Range("A1") = Now()

End Sub



---------------------------------------------------------
Hank Scorpio
scorpionet who hates spam is at iprimus.com.au (You know what to do.)
* Please keep all replies in this Newsgroup. Thanks! *