+ Reply to Thread
Results 1 to 4 of 4

Macro To reset UserForm

  1. #1
    Registered User
    Join Date
    04-02-2014
    Location
    Roseville, USA
    MS-Off Ver
    Excel 2013
    Posts
    15

    Macro To reset UserForm

    Greetings,
    I have created a user form on top of a spreadsheet. The user form is simply checkboxes that call macros to filter the spreadsheet. The checkboxes are all working as I need - check the box and the column is filtered for value yes, uncheck and column is filtered for no. My hurdle is creating some sort of reset functionality on the form if the user wants to start over. I'd like a reset button to not only clear the checkboxes on the form but also clear the filtering that the checkboxes executed on the form.

    I recorded a macro to reset the spreadsheet - clear all filters so all values are showing on the spreadsheet. The macro Macro is called ResetForm and it works as I need if I filter teh spreadsheet (without the form) and then run the macro. I thought I was on the right track by assigning the following to the Reset button:

    [/php]
    Private Sub ResetForm_Click()
    Unload UserForm1
    Call ResetForm
    UserForm1.Show
    End Sub
    [/php]

    Made sense to me - close the form, run the macro to reset the spreadsheet, and then pull the form up again.

    Run I select the button I get a error: Compile error: Invalid use of property. The Private Sub ResetForm_Click() line is hilighted. I'm guessing my approach to simple?

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro To reset UserForm

    Just to make sure I understand, is the ResetForm control a command button on UserForm1? If so this usually does the trick

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-02-2014
    Location
    Roseville, USA
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Macro To reset UserForm

    Correct - the ResetForm control is a button on UserForm1. My guess is the error is due to the Call ResetForm macro.

  4. #4
    Registered User
    Join Date
    04-02-2014
    Location
    Roseville, USA
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Macro To reset UserForm

    Went another route; no macro and added code on the Reset Form button:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Reset / Re-Initialize UserForm: Create new GUID
    By onmyway in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-01-2013, 04:41 AM
  2. [SOLVED] UserForm Reset Button does not work
    By Ambassador777 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2013, 12:14 PM
  3. Muultiple userform 'reset' code question
    By peter.thompson in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-21-2006, 08:23 PM
  4. Userform loses its capabilities...reset???
    By T.c.Goosen1977 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-30-2006, 03:01 AM
  5. Userform loses its capabilities...reset???
    By T.c.Goosen1977 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-29-2006, 10:43 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1