PDA

Click to See Complete Forum and Search --> : Excel - Experimenting with User Forms


Ecniv
Apr 30th, 2004, 08:16 AM
Hello,

Doing some processing, well reformatting in Excel of a large amount of data.

I'd prefer to use Access but thats not an option, so...
I have some code that works fairly fast, considering.
Now I have tried a userform as an information gathering form before styling the data (copying and styling) but it appears to be running slower from the code beind the button on the form than if I used the similar code but have a pop up word art to let the user know whats happening.

Is this usual?


Vince

Garratt
May 1st, 2004, 06:32 PM
Repaints of the form my be causing delays.

You could try adding in some screenupdating toggles to manually refresh the screen every so often (so the user doesn't think things have crashed.


Application.ScreenUpdating = False
'code
Application.ScreenUpdating = True
Application.ScreenUpdating = False
'code
Application.ScreenUpdating = True



If you are only using a form to gather data before a run, I would suggest that you hide the form and then run the code.


Private Sub MySub1()

userform1.show
'userform gathers data and the hides when something like a "RUN" button is clicked.

'code picks up here
End Sub


Lets say the user is filling in a textbox. When the code in a module starts up again (when the form is hidden,) just refer to the textbox on the form:

MyTempString = UserForm1.MyTextbox1.value

etc.