View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Charlie Charlie is offline
external usenet poster
 
Posts: 703
Default changing value on a userform

I put code in the initialize() sub of the form, but I can't figure out the
syntax. ...this must be close?
Private Sub UserForm_Initialize()
TextBoxtest = Sheet1!B23
End Sub
....then I'd put the same code in the combobox change() that affects
textboxtest? It's a combobox, not a listbox that I have that has an affect
on this 2nd textbox.

"carlo" wrote:

Take the control source away, because that overwrites the formula in
B1
Instead do following:
When you open the form and when after updating the listbox, assign the
value of b1 to the textbox.

hope you know what i mean.

Carlo

On Dec 21, 2:24 pm, Charlie wrote:
I have a cell (B1) that is this:
=IF(A1=1,"You may continue:"," ")
I have a textbox on a userform with the control source to this cell B1, when
I open the form, it shows "You may continue" in the text box, but when the
cell A1 is changed by a listbox on the same form to a number higher than 1,
now this text box becomes blank, which is what I expected. But when the form
is closed, now the formula in B1 is gone, B1 is blank. ...I just simply want
to display the value given by the formula in B1 on my form, but this value
can be changed with other controls on the form... Can this be done?