ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Public/Procedure Variable (https://www.excelbanter.com/excel-programming/290526-public-procedure-variable.html)

Otto Moehrbach[_6_]

Public/Procedure Variable
 
Excel 2003, WinXP
I have a called sub:
Sub Test(TheCell as Range)
End Sub

This declares TheCell as a procedure variable. I want to declare TheCell as
a Public variable. If I declare TheCell As Range as Public at the top of
the module, how do I write the "Sub" line of this macro? Thanks for your
help. Otto



Tom Ogilvy

Public/Procedure Variable
 
Sub Test()
msgbox thecell.Address
End Sub

You don't need to pass it if it is public.

--
Regards,
Tom Ogilvy

"Otto Moehrbach" wrote in message
...
Excel 2003, WinXP
I have a called sub:
Sub Test(TheCell as Range)
End Sub

This declares TheCell as a procedure variable. I want to declare TheCell

as
a Public variable. If I declare TheCell As Range as Public at the top of
the module, how do I write the "Sub" line of this macro? Thanks for your
help. Otto





Otto Moehrbach[_6_]

Public/Procedure Variable
 
And I hit myself in the forehead again. Why is it so obvious after you
explain it? Thanks Tom. Otto
"Tom Ogilvy" wrote in message
...
Sub Test()
msgbox thecell.Address
End Sub

You don't need to pass it if it is public.

--
Regards,
Tom Ogilvy

"Otto Moehrbach" wrote in message
...
Excel 2003, WinXP
I have a called sub:
Sub Test(TheCell as Range)
End Sub

This declares TheCell as a procedure variable. I want to declare

TheCell
as
a Public variable. If I declare TheCell As Range as Public at the top

of
the module, how do I write the "Sub" line of this macro? Thanks for

your
help. Otto








All times are GMT +1. The time now is 01:25 PM.

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