Update text box in real time

  • Thread starter Thread starter Cerberus
  • Start date Start date
C

Cerberus

Okay, one of three things is happening: 1) I’m not searching with the
correct key words. 2) It is so basic nobody has asked it. Or 3) it is not
possible and I’m wasting my time. I believe the first option is correct
though I could be wrong.

I want to know how to update information on a user form in real time. I
have a Combo Box That says the number of products you can get for this
category (0,1,2,3, or 4). Directly to the right of that Combo Box, I have a
Text Box that I want to say what is the max number of products left you can
choose for that category and I have that text reading the info from cell A1
on the worksheet. I came up with a formula that works with all the rules I
have in cell A1. When you change the Combo Box info from 0 to let's say 3,
A1 changes accordingly but the Text Box showing the max left to choose does
not change. I tried to put a…

TextAxLeft_Change()
Application.ScreenUpdating = True
End Sub

But that did not do jack for me. Any help on this will be appreciated.
 
try a combobox_change......

sub combobox1_change()

textaxleft.value = combobox1.value

end sub

hope that helps!
susan
 
Hi Cerberus ,
I think i can help. To populate the Text box from the worksheet thats easy
Private Sub UserForm_Initialize()
TextBox1.Value = Range("A1").Value
End Sub

Application.ScreenUpdating = True/False Wont do much for you in this case
 
Hi Cerberus

The below code may help you

Private Sub UserForm_Initialize()
TextBox1.Text = ""
End Sub
 
Thanks for your quick response on this. I already have the text box reading
A1 when the user form Initializes. The issue I have now is at the start, the
combo box reads 0 and the text box reads 3, if I change the combo box to 2
the text box still reads 3 instead of 1. A1 reads 1 but I can't get the Text
box to update unless I leave that user form and then come back.
 
Oh I think I Inderstand what your looking for... If you textbox holds the
total number of items available and the Combobox is the number of items
requested, there by reducing the total number available which you are
wanting to be relected in the text box right? If you put 100 in Cell A1 and
apply this code you will get exectly what i discribed above. If i have
completely misunderstood reply to this pos i will help as far as i can.

Private Sub ComboBox1_Change()
Me.TextBox1.Value = Range("A1").Value - ComboBox1.Value
End Sub

Private Sub UserForm_Initialize()
Dim X
For X = 1 To 5
Me.ComboBox1.AddItem X
Next X

Me.TextBox1.Value = Range("A1").Value
End Sub
 
Would that make the Text Box = Combo Box or would it make the Text Box = A1
after the Combo Box changes? Thanks for your help on this.
 
***Correction***
Private Sub ComboBox1_Change()
Me.TextBox1.Value = Range("A1").Value - ComboBox1.Value
Range("A1").Value = Me.TextBox1.Value
End Sub
This will update the worksheet as well
 

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