make text box visible after clicking option button

Adamhumbug

New Member
Joined
Feb 16, 2015
Messages
26
Hi All,

I have lots of forms with checkboxes on them. When the used clicks the checkbox, it makes a text box visible.

Currently i am putting the following code on every checkbox and changing the checkbox number and textbook number it refers to. Is there a better way of doing this than pasting it to every checkbox.

Thanks

Adam

Code:
If CheckBox1.Value = True ThenTextBox1.Visible = True
End If
If CheckBox1.Value = False Then
TextBox1.Visible = False
End If
If CheckBox1.Value = True Or CheckBox2.Value = True _
Or CheckBox3.Value = True Or CheckBox4.Value = True _
Or CheckBox5.Value = True Or CheckBox6.Value = True _
Or CheckBox7.Value = True Or CheckBox8.Value = True _
Or CheckBox9.Value = True Or CheckBox10.Value = True _
Or CheckBox11.Value = True Or CheckBox12.Value = True _
Or CheckBox13.Value = True Or CheckBox14.Value = True _
Or CheckBox15.Value = True Or CheckBox16.Value = True _
Or CheckBox17.Value = True Or CheckBox18.Value = True _
Or CheckBox19.Value = True Or CheckBox20.Value = True _
Or CheckBox21.Value = True Or CheckBox22.Value = True _
Or CheckBox23.Value = True Or CheckBox24.Value = True _
Or CheckBox25.Value = True Or CheckBox26.Value = True _
Or CheckBox27.Value = True Or CheckBox28.Value = True _
Or CheckBox29.Value = True Or CheckBox30.Value = True _
Or CheckBox31.Value = True Or CheckBox32.Value = True _
Or CheckBox33.Value = True Or CheckBox34.Value = True _
Or CheckBox35.Value = True Or CheckBox36.Value = True _
Then
Me.Label16.Visible = True
Else
Me.Label16.Visible = False
End If
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I thought i may have been able to do something like this:



Code:
dim i as integer

i = 1
[/FONT][/COLOR]
If CheckBox(i).Value = True ThenTextBox(i).Visible = True
End If[COLOR=#222222][FONT=Verdana]
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top