Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 237
Default Button Enabling based on check in checkbox

I have CheckBox1 and TextBox1 on a UserForm. The goal is
to only enable Textbox1 to be typed in only if checkbox1
has a check in it. I would like to achieve this by using
an IF THEN statement. All Responses are welcome.

Thank you in advance.

Todd Huttenstine
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Button Enabling based on check in checkbox

Todd chose:

Private Sub CheckBox1_Click()
If Checkbox1.Value = True Then
Textbox2.Enabled = True
Else
Textbox2.Enabled = False
End If
End Sub

in lieu of

Private Sub CheckBox1_Click()
Me.TextBox1.Enabled = CBool(Me.CheckBox1.Value)
End Sub

--
Regards,
Tom Ogilvy



Todd Huttenstine wrote in message
...
I have CheckBox1 and TextBox1 on a UserForm. The goal is
to only enable Textbox1 to be typed in only if checkbox1
has a check in it. I would like to achieve this by using
an IF THEN statement. All Responses are welcome.

Thank you in advance.

Todd Huttenstine



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Button Enabling based on check in checkbox

Hello Todd,

Give this a try:

Private Sub UserForm_Initialize()
'This will set the default value
Me.CheckBox1.Value = False
Me.TextBox1.Enabled = False
End Sub

Private Sub CheckBox1_Click()
If Me.CheckBox1.Value = True Then
Me.TextBox1.Enabled = True
Else
Me.TextBox1.Enabled = False
End If
End Sub

Regards,

Jon-jon

"Todd Huttenstine" wrote in message
...
I have CheckBox1 and TextBox1 on a UserForm. The goal is
to only enable Textbox1 to be typed in only if checkbox1
has a check in it. I would like to achieve this by using
an IF THEN statement. All Responses are welcome.

Thank you in advance.

Todd Huttenstine



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enabling Spell Check in Protected Worksheet Barb Reinhardt Excel Discussion (Misc queries) 2 May 10th 10 08:49 PM
Enabling voting button kd Excel Discussion (Misc queries) 0 April 24th 08 09:36 AM
check a checkbox in a formula big t Excel Worksheet Functions 1 June 16th 05 06:32 PM
Conditional Button Enabling based on Checkbox Todd uttenstine Excel Programming 11 November 25th 03 12:45 PM
Can't check ActiveX checkbox on worksheet onedaywhen Excel Programming 3 August 9th 03 02:34 AM


All times are GMT +1. The time now is 08:44 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"