need form to initialize without closing

B

bruce forster

I have a userform with several comboboxes and textboxes. When I change a selection in a combobox a certain "if" statement on the workbook is supposed to "fire", and it does, but the change is not reflected in the userform until i close and reopen. I am using a UserForm_Initialize() event. Any suggestions as to how I can have the changes on the worksheet be reflected on the userform without closing it.?

thanks
 
B

Bob Phillips

It would help to see the code.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

bruce forster said:
I have a userform with several comboboxes and textboxes. When I change a
selection in a combobox a certain "if" statement on the workbook is supposed
to "fire", and it does, but the change is not reflected in the userform
until i close and reopen. I am using a UserForm_Initialize() event. Any
suggestions as to how I can have the changes on the worksheet be reflected
on the userform without closing it.??
 
A

Anders S

Hi Bruce,

A Text Box in a User Form is (usually) not dynamic so you will have to refresh it in the code after the if statement has changed the worksheet.

For example:

Private Sub UserForm_Initialize()
Me.TextBox1.Text = ActiveSheet.Range("D1").Value
ActiveSheet.Range("D1").Value = Now()
Me.TextBox1.Text = ActiveSheet.Range("D1").Value
End Sub

HTH
Anders Silven
 
Top