Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Can I have the same variable names in multiple different "forms"inside my personal.xls?

Can I have the same variable names in multiple different "forms"
inside my personal.xls? In other words in form1 I have a variable
called SaveToDesktop adn in form2 I also have a variable called
SaveToDesktop.

Is this OK to have the same variable name in two different user forms
in the same personal.xls file? This "variable" represents a control
in each form.

Thanks,
Chet
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Can I have the same variable names in multiple different "forms" inside my personal.xls?

Yes, it is perfectly legal to have variables with the same name in more than
one form or other type of object module.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



"Chet" wrote in message
...
Can I have the same variable names in multiple different "forms"
inside my personal.xls? In other words in form1 I have a variable
called SaveToDesktop adn in form2 I also have a variable called
SaveToDesktop.

Is this OK to have the same variable name in two different user forms
in the same personal.xls file? This "variable" represents a control
in each form.

Thanks,
Chet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Can I have the same variable names in multiple different "forms"inside my personal.xls?

On Mar 19, 11:57*am, "Chip Pearson" wrote:
Yes, it is perfectly legal to have variables with the same name in more than
one form or other type of object module.

--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
* * Excel Product Group
Pearson Software Consulting, LLCwww.cpearson.com
(email on web site)

"Chet" wrote in message

...



Can I have the same variable names in multiple different "forms"
inside my personal.xls? * In other words in form1 I have a variable
called SaveToDesktop adn in form2 I also have a variable called
SaveToDesktop.


Is this OK to have the same variable name in two different user forms
in the same personal.xls file? *This "variable" represents a control
in each form.


Thanks,
Chet- Hide quoted text -


- Show quoted text -


Thank you Chip... I will investigate further. I am getting an
"ambigbuous name detected" message and thought that might be the
name. Oddly though when I did make the variable names different in
each form code section the ambiguous name error message did not occur.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Can I have the same variable names in multiple different "forms" inside my personal.xls?

I was referring to having variables with the same name in *object modules*
(Class modules, ThisWorkbook, the Sheet modules, Userforms), not duplicating
names in standard modules. I would strongly recommend that you *not* have
duplicate names in standard modules unless those variables are declared
Private to the module.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



"Chet" wrote in message
...
On Mar 19, 11:57 am, "Chip Pearson" wrote:
Yes, it is perfectly legal to have variables with the same name in more
than
one form or other type of object module.

--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLCwww.cpearson.com
(email on web site)

"Chet" wrote in message

...



Can I have the same variable names in multiple different "forms"
inside my personal.xls? In other words in form1 I have a variable
called SaveToDesktop adn in form2 I also have a variable called
SaveToDesktop.


Is this OK to have the same variable name in two different user forms
in the same personal.xls file? This "variable" represents a control
in each form.


Thanks,
Chet- Hide quoted text -


- Show quoted text -


Thank you Chip... I will investigate further. I am getting an
"ambigbuous name detected" message and thought that might be the
name. Oddly though when I did make the variable names different in
each form code section the ambiguous name error message did not occur.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Range("C100:D200").Select with variable names Fan924 Excel Programming 2 October 15th 07 03:54 PM
Question on determining "ROW" inside of a "For .. RANGE " loop David Schrader[_2_] Excel Programming 2 January 3rd 07 08:18 PM
Listbox header inside VBA (Array("Head1", "Head2", ...) Alex St-Pierre Excel Programming 2 October 25th 06 09:28 PM
using a "variable" in range names Adam Kroger Excel Discussion (Misc queries) 9 December 11th 05 07:17 PM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM


All times are GMT +1. The time now is 03:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"