Swap values in userform txtboxes
Hi,
Assign this code to your checkbox and ti will flip the values when checked -
un-checked,
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
tempval = Txtheight.Text
Txtheight.Text = Txtwidth.Text
Txtwidth.Text = tempval
End If
If CheckBox1 = False Then
tempval = Txtwidth.Text
Txtwidth.Text = Txtheight.Text
Txtheight.Text = tempval
End If
End Sub
Mike
"CR" wrote:
I have two txtboxes on a userform.
txtheight and txtwidth, I want to add a checkbox that will change the value
of the height box (11) to the value of the width box (14) and vice versa.
In other words, change the two boxes from 11x14 to 14x11.
Thank you
CR
|