Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default REPOST: showing a userform

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default REPOST: showing a userform

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.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"boris" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default thanks

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
-----Original Message-----
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.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"boris" wrote in message
...
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



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Had to repost it!!! Prashant Excel Discussion (Misc queries) 1 April 23rd 10 03:19 PM
Repost! Richard Excel Discussion (Misc queries) 1 September 26th 09 01:10 PM
How to fix my spreadsheet from showing formula to showing answer SimplyQuick Excel Discussion (Misc queries) 4 October 7th 08 10:00 PM
How to fix my spreadsheet from showing formula to showing answer SimplyQuick Excel Discussion (Misc queries) 0 October 7th 08 06:38 PM
Showing/ not showing "getting started" when excel starts Ask Excel Discussion (Misc queries) 1 July 20th 05 04:20 PM


All times are GMT +1. The time now is 03:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"