Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: How to auto update Userform.textbox value on each pass thru

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I must be missing the blindingly obvious.
    In Lotus I could automatically update the display in a msgbox with each pass thru a loop.
    How can I do this with a userform in Excel so that the value in a textbox automatically changes with each loop?

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    =ActiveCell.Address
    Posts
    478
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    It might be that I am missing the point of your post but to set the value of a textbox in a userform all you need to write is something like:

    UserForm1.yourTextBox.Value = yourVariableHere

    before you display the userform (Userform1.Show)

    Surely each time you pass through the loop you can reset yourVariableHere to whatever value you want?

    If I'm on the wrong track, give us all a bit more information and see what other ideas are thrown up!

    Rgds
    AJ



  3. #3
    New Member
    Join Date
    Mar 2002
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    CommandButton1 is on Userform1. Textbox1 does not increment on each loop. I only get the end value (1000) on the last loop, ;o(

    Private Sub CommandButton1_Click()
    For x = 1 To 1000
    UserForm1.TextBox1.Value = x
    Next
    End Sub

  4. #4
    New Member
    Join Date
    Mar 2002
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    REPAINT seems to be the answer. It updates the textbox on each loop but does cause some userform 'flutter'.

    Private Sub CommandButton1_Click()
    For x = 1 To 1000
    USERFORM.REPAINT
    UserForm1.TextBox1.Value = x
    Next
    End Sub

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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