Passing Arguments in Excell function

U

ub

Hi
Is there any way , I can pass arguments in Excell 'Range', object when
wrting a VBA code.
 
J

JE McGimpsey

One way:

Public Sub Try()
Dim rTest As Excel.Range
Set rTest = ActiveSheet.Range("A1:J10")
PassRange rTest
End Sub

Public Sub PassRange(byRef rTest As Range)
Msgbox "The range is " & rTest.Address(False, False)
End Sub
 
Top