200 Checkboxes Method works great but errors when used in conjunction with other code.

bcarter0174

New Member
Joined
Feb 11, 2022
Messages
2
Office Version
  1. 365
Hello. The "200 CheckBoxes" method works great but gives "Run-time error "13" in the Checkbox code when execution other code. The program halts at the "If Target.Value = Chr(168) Then" statement. It occurs when more than one check box is selected and after executing any macro that executes range copy instructions? Any suggestions on how to eliminate this issue?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I never recommend using a large number of checkboxes.
What are these checkboxes used for?
I recommend using the double click method.
Double click any cell in column A for example and a script will run.
With checkboxes the script normally be like:
If checkbox1.value=True then Msgbox "Hello"
If checkbox1.value=False then Msgbox "Goodbye"
With double click you could double click on the value "Hello"
And the script would look like this:
Msgbox Target.Value
 
Upvote 0
I suspect The "200 CheckBoxes" method is from MrExcel Podcast 1871 and double click is already being used.
Can you post your code so we can see what interaction(s) may be causing the issue?
 
Upvote 0
I am using the CheckBox method from MrExcel Podcast 1871.

Requested VBA Code is attached.
 

Attachments

  • VBA Code to MrExcel.jpg
    VBA Code to MrExcel.jpg
    81 KB · Views: 12
Upvote 0
It appears from what I see here you are still doing what I suggested using double click. But your trying to place text in the column that looks like a checkbox it's not really a checkbox.
And you're still going to need to double click. And what is supposed to happen when you select this Checkbox? You have never said if checkbox=True do what or if not true do what.
Why not enter some text in column A that will toggle from Yes to No when you double click?
 
Upvote 0
Here is a sample script that might work for you depending on exactly what you're trying to do.

If you double, click on any cell in column A the script will look for a value in column D of the same row. If the script finds the cell in column D has "Yes" Or "No" then the cell in column A that you double clicked in will have the Value "Good Job" entered but if not, the cell you doubled click on will have the value "No" entered
VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'Modified  2/13/2022  2:48:02 AM  EST
If Target.Column = 1 Then
Cancel = True
    Select Case Target.Offset(, 3).Value
        Case "Yes", "No"
            Target.Value = "Good Job"
        
        Case Else
            Target.Value = "No"
        
    End Select
        
End If
End Sub
 
Upvote 0
Hey MAIT why don't you wait for the OP to respond ?

The best example is the MrExcel Podcast 1871 itself,
which the OP indicates using. It just appears they missed the part where
MrExcel selects and uses BeforeDoubleClick (at about the 4:30 mark)

I know you say you never click on links but it might be a good idea to watch that video
and not add confusion with what you post.

As for addressing the actual question the OP asked... I'll wait for their response
because if it wasn't just that minor oversite then there's a lot more explanation required.
 
Upvote 0

Forum statistics

Threads
1,215,035
Messages
6,122,791
Members
449,095
Latest member
m_smith_solihull

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