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