+ Reply to Thread
Results 1 to 2 of 2

help!! reset a form

  1. #1
    pywhacket
    Guest

    help!! reset a form

    How do you reset a form after macros have run? I have a macro that deletes
    all lines that have a 0 in column C after data has been pulled in from other
    sheets. I need to add a button that will restore the form to it's original
    state.

    Thanks!


  2. #2
    Tom Ogilvy
    Guest

    RE: help!! reset a form

    If you mean useform, then you need to put in code that resets each control
    individually.

    Easier it to unload the form and then show it again. Don't do that from the
    code in the form itself however. handle that in the code that shows the
    form.

    Public bshowform as boolean

    Sub Main()
    bshowform = True
    do while bshowform
    userform1.show
    Loop
    End Sub

    in the userform code

    Private Sub cmdClose_click()
    bShowForm = False
    unload me
    End Sub

    Private Sub cmdExecute_click()
    ' code that works on your sheet
    bshowform = True
    unload me
    End Sub

    --
    Regards,
    Tom Ogilvy



    --
    Regards,
    Tom Ogilvy


    "pywhacket" wrote:

    > How do you reset a form after macros have run? I have a macro that deletes
    > all lines that have a 0 in column C after data has been pulled in from other
    > sheets. I need to add a button that will restore the form to it's original
    > state.
    >
    > Thanks!
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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