Keeping macros neat

  • Thread starter Thread starter verizon
  • Start date Start date
V

verizon

Hello Board

I have read that good programmers create many subroutines when programming
so that many macros can use repetitive routines. it also makes it easier to
track down problems. I concur.

Nonetheless it is distracting to have all of those subroutines show up in my
macro window. They are not independently executable and it requires that I
scroll through many unwanted macros to get to the ones that i want.

How do I prevent the macros which are only "useful subroutines" from
appearing in my macro window?

Thank you

W
 
.... also

If they have arguments, they will not show up in the list, as you cannot
pass an argument value in the list. And if they do repetitive tasks, it is
often the same task, but on different data, so there is a need to pass a
reference to the data to be acted upon.
 
Just for interest, while of not much utility, you can run a sub like
Sub Tester3(sStr As String)
Debug.Print "tester3: " & sStr
End Sub

from the textbox of the Tools=>Macro=>Macros dialog by entering

'tester3 "Hello"'

and hitting enter or clicking the run button - but it isn't displayed in the
list.

Based on some other information on xl2002, this may not be possible there -
I haven't tested it in xl2002.

Regards,
Tom Ogilvy
 
Just for interest, while of not much utility, you can run a sub like
Sub Tester3(sStr As String)
Debug.Print "tester3: " & sStr
End Sub

from the textbox of the Tools=>Macro=>Macros dialog by entering

'tester3 "Hello"'

and hitting enter or clicking the run button - but it isn't displayed in the
list.

Based on some other information on xl2002, this may not be possible there -
I haven't tested it in xl2002.

This still works in xl2002.

Personally I tend to keep "helper" procedures off the list by making
them functions rather than subs (which also allows me to pass back a
Boolean argument indicating a successful outcome or otherwise)...
although the down side of that is that they can then show up as user
defined Worksheet functions in the formula wizard. Don's original
suggestion of making them Private is the safest way out, IMHO.
 
That was it. (I live with Medium at home and Low at work.)

hmmmm. Why would xl stop it if I already said ok to macros (with medium)?
Rhetorical question only!
 
Back
Top