ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Passing Arguments in Excell function (https://www.excelbanter.com/excel-discussion-misc-queries/130482-passing-arguments-excell-function.html)

UB

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

vezerid

Passing Arguments in Excell function
 
The answer is yes, there is. What exactly do you want to do?


On Feb 13, 5:57 pm, ub wrote:
Hi
Is there any way , I can pass arguments in Excell 'Range', object when
wrting a VBA code.




JE McGimpsey

Passing Arguments in Excell function
 
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


In article ,
ub wrote:

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



All times are GMT +1. The time now is 04:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com