Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like this...
Private Sub CheckBox1_Click() Dim Temp As String Temp = txtheight.Value txtheight.Value = txtwidth.Value txtwidth.Value = Temp End Sub -- Rick (MVP - Excel) "CR" wrote in message m... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Swap values in a stacked bar pivot chart | Charts and Charting in Excel | |||
swap values between two cells | Excel Worksheet Functions | |||
There should be a swap function for 2 values | Excel Discussion (Misc queries) | |||
Swap range values | Excel Programming | |||
Populating txtboxes | Excel Programming |