+ Reply to Thread
Results 1 to 3 of 3

Userforms

  1. #1
    Registered User
    Join Date
    03-22-2005
    Posts
    31

    Userforms

    Hi everyone,
    Currently I have a userform which entitles people to search up a street number and name, and click on a command button ("search") which runs a macro extracting data frome sheet 1 to sheet 2, provided it matches the criteria.

    What I'm having trouble with is when you click search, the macro jumps between sheet 1 and sheet 2 several times running the filter. On sheet 1, when you select it, I automatically make it to bring up userform1, and whenever the search finishes, userform1 remains open, but I want it to close.
    Now I have tried putting in userform1.hide at the end of the macro and that doesn't help.

    Is there any way to disable the the sheet1's code userform1.show until the macro finishes executing, or something similar? I only want it to show up when you manually click the sheet, not when the macro accesses it.

    Thanks,

    Andrew G

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good morning Carlito_1985

    You need tio use this command when you start the macro:

    Application.ScreenUpdating=False

    and make this the last line of your macro:

    Application.ScreenUddating=True

    This will stop the screen from flickering while the data is being retrieved, and it will also make the search process much quicker.

    HTH

    DominicB

  3. #3
    Registered User
    Join Date
    03-22-2005
    Posts
    31
    Ahhhh, Brilliant!!
    So easy yet so useful.
    Much appreciated, worked perfectly.

+ 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