View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Henry[_4_] Henry[_4_] is offline
external usenet poster
 
Posts: 72
Default UserForm_Initialize? How to update.

Jelso,
The form should open with the values from the cells in the textboxes.
Are you changing the cell value after you initialize the form?
If so, after you've changed the cell values try (in a Sub):
Myuserform.repaint.

If that doesn't do it then just get the values again
Private Sub DoSomething_click()

'change the values in the cells
Range("C1").Value = Range("C1").Value +3
Range("E3").Value = Range("E3").Value*3
Range("E4").Value = Range("E4").Value -3
Range("E5").Value = Range("C1").Value + Range("E3").Value +Range("E4").Value

'reset the textboxes
Title.Text = Range("C1").Value
SAMTitle.Text = Range("E3").Value
SAM1.Text = Range("E4").Value
SAM2.Text = Range("E5").Value

End Sub

HTH
Henry
"Jelso" wrote in message
om...
Question: If I use UserForm_Initialize when calling up a form with
text boxes, the text boxes won't update if their source cells change.

Is there some other word/commmand I should use instead of "Initialize"
to have the text boxes update with new data? Or is the problem
elsewhere?

Thanks..SJ

------------------------------------
Private Sub UserForm_Initialize()

Title.Text = Range("C1").Value

SAMTitle.Text = Range("E3").Value
SAM1.Text = Range("E4").Value
SAM2.Text = Range("E5").Value
-----------------------------------