ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Renaming a UDF param renames the params of ALL UDFs. (https://www.excelbanter.com/excel-programming/432954-renaming-udf-param-renames-params-all-udfs.html)

Jim Luedke

Renaming a UDF param renames the params of ALL UDFs.
 
Will someone please tell me why, when two VBA functions have
identically-spelled parameters, e.g.:

Func1(ByVal MyParam1 as <Something, <More params)
Func2(ByVal MyParam2 as <Something, <More params)

then, when I rename Func1 parameter "MyParam1" to "MyOwnParam1", VBA:

=== renames the spelling of Func2's param to "MyOwnParam1" as well?

What is *with* this sick language?

Is there some Option (akin to Option Explicit) I don't know about,
that turns this off?

***

Rick Rothstein

Renaming a UDF param renames the params of ALL UDFs.
 
When you evoke the Replace dialog box, take a look at the lower left corner
of it... there is a Search frame containing some OptionButtons that allow
you to control what gets replaced. Just put your text cursor in the
procedure you want to change, select the Current Procedure OptionButton from
the Search frame and that will restrict your replacement to only the text in
the procedure the text cursor it in. Alternately, you can select all the
text in the code you want to do the replacement in, select the Selected Text
OptionButton and your replacements will be restricted to just the selected
text. These, coupled with the other two OptionButtons, allows you quite a
bit of flexibility and control in a replacement (or Find for that matter)
operation.

--
Rick (MVP - Excel)


"Jim Luedke" wrote in message
...
Will someone please tell me why, when two VBA functions have
identically-spelled parameters, e.g.:

Func1(ByVal MyParam1 as <Something, <More params)
Func2(ByVal MyParam2 as <Something, <More params)

then, when I rename Func1 parameter "MyParam1" to "MyOwnParam1", VBA:

=== renames the spelling of Func2's param to "MyOwnParam1" as well?

What is *with* this sick language?

Is there some Option (akin to Option Explicit) I don't know about,
that turns this off?

***




All times are GMT +1. The time now is 10:51 PM.

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