#1   Report Post  
Posted to microsoft.public.excel.misc
damorrison
 
Posts: n/a
Default TextBox1 to Label4

In a UserForm I would like a Label to Have the value of TextBox1 less 1

  #2   Report Post  
Posted to microsoft.public.excel.misc
Paul Lautman
 
Posts: n/a
Default TextBox1 to Label4

damorrison wrote:
In a UserForm I would like a Label to Have the value of TextBox1 less
1



Private Sub TextBox1_Change()
Label1.Caption = TextBox1.Text - 1
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.misc
damorrison
 
Posts: n/a
Default TextBox1 to Label4

Exelent Thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
damorrison
 
Posts: n/a
Default TextBox1 to Label4

Now everytime the user form shows the textbox keep the old value ?

  #5   Report Post  
Posted to microsoft.public.excel.misc
Paul Lautman
 
Posts: n/a
Default TextBox1 to Label4

damorrison wrote:
Now everytime the user form shows the textbox keep the old value ?


Are you asking how to keep the last value entered??

If so you need to store the previous value somewhere.

Try the following:

Private Sub TextBox1_Change()
Label1.Caption = TextBox1.Text -1
[a1].Value = Label1.Caption
End Sub


Private Sub UserForm_Activate()
Label1.Caption = [a1].Value
End Sub




  #6   Report Post  
Posted to microsoft.public.excel.misc
damorrison
 
Posts: n/a
Default TextBox1 to Label4

Sorry,
I wasn't writing what I was thinking,

When I enter a value in the textbox the Label works properly,
When I show the , OH crap I just realized I had entered a number in the
UserForm when I was editing it, that's why there was a number in there
all the time,
Thanks

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



All times are GMT +1. The time now is 04:15 PM.

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

About Us

"It's about Microsoft Excel"