Results 1 to 6 of 6

Thread: Calling a procedure with a Userform

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2003
    Location
    Upstate NY
    Posts
    19

    Calling a procedure with a Userform

    I hope I explain this well.

    I have 2 workbooks. One is a compilation ofdata from 4 different worksites. The other holds the monthly totals from the first book on a sheet that shows Jan thru Dec in each year, with the last several years for comparison.
    2000 2001 2002 2003 2004
    Jan
    Feb
    March (just to give you an idea)

    i have the macro worked out to open the second book, and copy/paste the info to the proper site, month year (a macro for each month). What I don't have is a way to Call the proper month. I created a user form with OptionButtons, one for each month. Now it was easy enough to plug in
    OptionButton1_Click()
    Sub
    Call January
    End Sub

    But it executes immediately, as soon as I click the Month (optionButton). I wanted a way to protect myself from clicking too quickly and making a mistake, so I wanted to be able to click the month, and then press ENTER to execute the Call. This way I could look things over before I make a mistake.

    Should I use check boxes instead? Any suggestions would be appreciated.
    If I have been unclear, please let me know and I will try to clarify.

    Thanks again for your help.

    Don

    Edit: I use Office XP 2002. Also, I tried declaring a variable (eg myMonth),
    and then
    Call myMonth
    but it simply will not do it. ( i obviously could have written it wrong) I keep getting the error "Expexted Sub, Function, or procedure"

    Thanks
    Last edited by Toolman; Feb 11th, 2005 at 05:10 PM.
    Don

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width