Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you create a public variable, and don't (very important) define the same
name in the subs, there is only one vraiable, and wherever that is changed it will be picked up in the other module. For instance, try this Public Count Sub MySub() Count = 1 msgbox "MySub: " & Count Fred msgbox "MySub: " & Count End Sub Sub Fred() Count=Count+1 msgbox "Fred: " & Count End Sub You should see MySub: 1 Fred: 2 MySub: 2 -- HTH RP (remove nothere from the email address if mailing direct) "JimFor" wrote in message ... Thanks. I'll try these. If I make a variable a Public variable and it appears in Fred, would MySub automatically use the value I assign it in Fred no matter what it would have been in MySub without what happens in Fred? Not sure this is happening with. me. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I stop "global" hyperlinks changing to "local" links? | Excel Worksheet Functions | |||
How do I set up a "roll over" counter in excel 2003? | Excel Worksheet Functions | |||
multiple file uploading - runtime error'13': type mismatch "While Counter <= UBound(FName)" | Excel Discussion (Misc queries) | |||
Excel: Changing "numeric $" to "text $" in a different cell. | Excel Worksheet Functions | |||
Changing "returned" values from "0" to "blank" | Excel Worksheet Functions |