Userforms

  • Thread starter Thread starter carlito_1985
  • Start date Start date
C

carlito_1985

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

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

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

Thanks,

Andrew
 
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 bein
retrieved, and it will also make the search process much quicker.

HTH

Dominic
 
Ahhhh, Brilliant!!
So easy yet so useful.
Much appreciated, worked perfectly. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top