View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Office_Novice Office_Novice is offline
external usenet poster
 
Posts: 245
Default Update text box in real time

***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

"Office_Novice" wrote:

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


"Cerberus" wrote:

Okay, one of three things is happening: 1) Im not searching with the
correct key words. 2) It is so basic nobody has asked it. Or 3) it is not
possible and Im 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.