View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
eliano eliano is offline
external usenet poster
 
Posts: 25
Default 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