Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looking for an alternative programming technique
I have five lines of codes which are used several times over in different
parts of the same program. I could treat them as a separately named procedure, and call on that name but I wonder if there is a simpler way. With Excel4 macro it was easy to loop using the "Goto" command. Is there something similar with VBA? Any other suggestions? TIA Tom |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looking for an alternative programming technique
Hi Tom.
Try: Public Sub fivelinesofcode() €¦your five lines of code End sub Public Sub Mastercode() €¦your code fivelinesofcode €¦your code fivelinesofcode €¦your code fivelinesofcode End Sub Pay attention. Variables in your five lines code might be defined as Public Regards Eliano "Tom" wrote: I have five lines of codes which are used several times over in different parts of the same program. I could treat them as a separately named procedure, and call on that name but I wonder if there is a simpler way. With Excel4 macro it was easy to loop using the "Goto" command. Is there something similar with VBA? Any other suggestions? TIA Tom |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looking for an alternative programming technique
Thanks. It's a fraction shorter, I think.
Regards, Tom "eliano" wrote in message ... Hi Tom. Try: Public Sub fivelinesofcode() .your five lines of code End sub Public Sub Mastercode() .your code fivelinesofcode .your code fivelinesofcode .your code fivelinesofcode End Sub Pay attention. Variables in your five lines code might be defined as Public Regards Eliano "Tom" wrote: I have five lines of codes which are used several times over in different parts of the same program. I could treat them as a separately named procedure, and call on that name but I wonder if there is a simpler way. With Excel4 macro it was easy to loop using the "Goto" command. Is there something similar with VBA? Any other suggestions? TIA Tom |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Paste Special (or some other technique) | Excel Discussion (Misc queries) | |||
TIP: Powerful automation technique | Excel Discussion (Misc queries) | |||
Best Technique to clone worksheet | Excel Programming | |||
Hide Password Technique ??? | Excel Programming | |||
Programming of alternative actions in VB macros | Excel Programming |