Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Jim is offline
external usenet poster
 
Posts: 615
Default Update user form labels

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Update user form labels

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Update user form labels

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Form: Cannot Update Text Box Charles in Iraq Excel Discussion (Misc queries) 0 October 12th 06 07:53 AM
Update Range from User Form fybar[_2_] Excel Programming 1 April 2nd 06 01:27 AM
Find and Update with User Form prodsched[_7_] Excel Programming 0 May 18th 04 03:35 PM
Creating a User Form to update a list Gary Hall Excel Programming 1 January 4th 04 03:02 PM
Labels in a user form John Stout Excel Programming 5 November 10th 03 01:42 PM


All times are GMT +1. The time now is 09:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"