![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 18
|
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 |
|
Board Regular
Join Date: Mar 2002
Location: =ActiveCell.Address
Posts: 478
|
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 |
|
New Member
Join Date: Mar 2002
Posts: 18
|
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 |
|
New Member
Join Date: Mar 2002
Posts: 18
|
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 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|