Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a user form where the user enters a number into a textbox1 which is
linked to cell H2 in the work sheet. This then changes the result of another cell "N2". I want this result to be shown on the user form. At the moment i have a label to display the result with code as follows: Private Sub Label1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Me.Label1.Caption = ActiveSheet.Range("n2") End Sub This works fine but in order for the value to be updated you have to move the mouse over the label. Can the label be updated as soon as the value is typed into the textbox1? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
Why not use a TextBox (possible with .Enabled=False or .Locked=True) and set it controlSource. This assumes that you are showing the userform with vbModeless. NickHK "Jim" wrote in message ... I have a user form where the user enters a number into a textbox1 which is linked to cell H2 in the work sheet. This then changes the result of another cell "N2". I want this result to be shown on the user form. At the moment i have a label to display the result with code as follows: Private Sub Label1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Me.Label1.Caption = ActiveSheet.Range("n2") End Sub This works fine but in order for the value to be updated you have to move the mouse over the label. Can the label be updated as soon as the value is typed into the textbox1? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use the Textbox AfterUpdate event.
-- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Jim" wrote in message ... I have a user form where the user enters a number into a textbox1 which is linked to cell H2 in the work sheet. This then changes the result of another cell "N2". I want this result to be shown on the user form. At the moment i have a label to display the result with code as follows: Private Sub Label1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Me.Label1.Caption = ActiveSheet.Range("n2") End Sub This works fine but in order for the value to be updated you have to move the mouse over the label. Can the label be updated as soon as the value is typed into the textbox1? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
User Form: Cannot Update Text Box | Excel Discussion (Misc queries) | |||
Update Range from User Form | Excel Programming | |||
Find and Update with User Form | Excel Programming | |||
Creating a User Form to update a list | Excel Programming | |||
Labels in a user form | Excel Programming |