Passing Arguments in Excell function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
Is there any way , I can pass arguments in Excell 'Range', object when
wrting a VBA code.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top