Results 1 to 2 of 2

Thread: Excel - Experimenting with User Forms

  1. #1

    Thread Starter
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Excel - Experimenting with User Forms

    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

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  2. #2
    Addicted Member
    Join Date
    Dec 2001
    Posts
    158
    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.

    Code:
    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.

    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:

    Code:
    MyTempString = UserForm1.MyTextbox1.value
    etc.

Posting Permissions

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



Click Here to Expand Forum to Full Width