REPOST: showing a userform

B

boris

Have a button on a sheet which I want to have call a
procedure that simply shows a userform. I am assigning
the macro to the button and the procedure is

Sub GetPrintPrefs()
' Shows the PrintSelection userform, then runs
PrintSelection
' procedure to do actual print

PrintSelection.Show

End Sub

, with PrintSelection being the name of the userform. I
thought it was that simple, but it gives me a "Compile
Error: Expected Function or variable".

Help?

Boris
 
D

Dick Kusleika

Boris

Which line is highlighted when you get that error? If it's the Show line,
then make sure you spelled the userform name correctly. Also the second
line of your sub doesn't have a comment indicator although that may be due
to line wrap in your message. Otherwise it look OK to me.
 
B

boris

Dick, oddly enough, it was the blank line after the
statement, before the End Sub that needed taking out. I
don't know if that's common, but I am almost certain that
Excel doesn't care about that. As far as the name, I
knew I had spelled it right because I do no caps
intentionally to have Excel capitalize as I am writing.
Anyway, works now. Thanks for the help.

Boris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top