TextBox1 to Label4

P

Paul Lautman

damorrison said:
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
 
P

Paul Lautman

damorrison said:
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
 
D

damorrison

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
 
Top