Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating Textbox in Form

Status
Not open for further replies.

zedutch

Technical User
May 10, 2007
4
CA
I have a textbox in a form in Excel that is linked to a cell on the main sheet. This cell is continuously updating on the sheet but the textbox does not update. Is there a way to continuously refresh the value in the textbox?

- Eric
 
What is the value of the ControlSource property of the textbox ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I simply have: txtInAmpsA.Value = Cells (15,15)
On the main sheet, Cell(15,15) updates regularly but on the form, the textbox remains as it was when I first opened the form.
 
Sheet_Change event? This will only work if the userform has SystemModal = False. Otherwise focus would remain with the userform.

Why are you using a textbox? Is the user actually going to be entering data into it? If it is just displaying data - ie. no actual user input - then use a Label.

In the userform:
Code:
Sub UserForm_Initialize()
   Label1.Caption = Worksheets("Sheet1").Cells(1, 1).Value
End Sub

In the Sheet module:
Code:
Sub Worksheet_Change(ByVal Target As Range)
   UserForm1.Label1.Caption = _
        Worksheets("Sheet1").Cells(1, 1).Value
End Sub
If the userform is SystemModal = False, and the cell value is changed, the new value immediately updates the label on the userform.

I am probably doing it wonky, but then...I am not an Excel guy.

Gerry
My paintings and sculpture
 
What about this ?
txtInAmpsA.ControlSource = "O15"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top