If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > disable checkboxes on true/false

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-05-07, 12:18
mike21152 mike21152 is offline
Registered User
 
Join Date: Sep 2006
Posts: 60
disable checkboxes on true/false

Hi - I've been trying to come up with a way to disable checkboxes based on a true/false condition. Sounds simple, eh? Well, maybe not.

I looked around for a simple way to do this in VBA. Here's what I want to do:

Let's say I have 3 ranges of cells: C2:C6 has true/false values from E2-E6 which have checkboxes connected to them. D2-D6 has text in them that according to my conditional formatting turn grey if the adjacent cell(s) - C2-C6 - are FALSE. I tried a loop to disable the checkboxes based on this, but seems to disable ALL of them.

On Error Resume Next
Dim c As Range, myRange As Range
Set c = [C2:C6]
Set myRange = selection
For Each c In myRange.Cells
If c.Value = "False" Then
ActiveSheet.CheckBox.Select
With selection
.Enabled = False
End With
' c.Select
End If
Next



Any suggestions?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On