Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Coding for checkbox (SC)

Can anyone pls help me with this code.

Sub Validation()
If CheckBox1.Value = Checked Then
Worksheets("Form").Range("F_Name").Enabled = True
Else
Worksheets("Form").Range("F_Name").Enabled = False
End If

End Sub

I have written this code for a check box. If the check box is checked
then a cell named F_Name should be able to take in values entered. If
the check box is not selected then the F_Name field should be
deactivated or greyed out so that no values can be entered.

The code above throws a run time error '438': Object doesn't support
this property or method.

Can anyone help me fix this.. is this a code error or Excel property
that needs to be changed

Thanks in advance for you help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Coding for checkbox (SC)

Cells don't have an enabled property. You can set the Locked property to
true or false. However, to activate it, the worksheet must be protected.
And you must turn off protection to change the locked property.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

wrote in message
oups.com...
Can anyone pls help me with this code.

Sub Validation()
If CheckBox1.Value = Checked Then
Worksheets("Form").Range("F_Name").Enabled = True
Else
Worksheets("Form").Range("F_Name").Enabled = False
End If

End Sub

I have written this code for a check box. If the check box is checked
then a cell named F_Name should be able to take in values entered. If
the check box is not selected then the F_Name field should be
deactivated or greyed out so that no values can be entered.

The code above throws a run time error '438': Object doesn't support
this property or method.

Can anyone help me fix this.. is this a code error or Excel property
that needs to be changed

Thanks in advance for you help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Coding for checkbox (SC)

On Mar 26, 5:15 pm, "Bob Flanagan" wrote:
Cells don't have an enabled property. You can set the Locked property to
true or false. However, to activate it, the worksheet must be protected.
And you must turn off protection to change the locked property.

Bob Flanagan
Macro Systemshttp://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

wrote in message

oups.com...



Can anyone pls help me with this code.


Sub Validation()
If CheckBox1.Value = Checked Then
Worksheets("Form").Range("F_Name").Enabled = True
Else
Worksheets("Form").Range("F_Name").Enabled = False
End If


End Sub


I have written this code for a check box. If the check box is checked
then a cell named F_Name should be able to take in values entered. If
the check box is not selected then the F_Name field should be
deactivated or greyed out so that no values can be entered.


The code above throws a run time error '438': Object doesn't support
this property or method.


Can anyone help me fix this.. is this a code error or Excel property
that needs to be changed


Thanks in advance for you help.- Hide quoted text -


- Show quoted text -


I did try your fix, the error message does not appear however if the
check box is unchecked it does not lock the cell F_Name. I also
protected the sheet and truned off the the locked option in format
cell properties.

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
How to have Checkbox A uncheck with checked Checkbox B Texas Aggie Excel Discussion (Misc queries) 3 July 20th 07 10:58 PM
link a checkbox in a sheet to a checkbox on a userform? Arjan Excel Programming 0 November 10th 06 01:37 PM
How do I link one checkbox to update another checkbox? Mike Excel Programming 3 April 28th 06 02:22 AM
checkbox on form reset from checkbox on sheet raw[_12_] Excel Programming 1 December 3rd 05 05:08 AM
Implant macro coding into ASP coding Sam yong Excel Programming 5 September 15th 05 10:37 AM


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