I have below a VBA code that checks 3 checkboxes one after the other, everytime a specific word appears in a cell.
Because my workbook is slowing down a lot due to the heavy amount of checkboxes I have, I want to see what the performances would be if I were to replace those checkboxes by a False/True statement according the number of times the specific word appears.
Here is the code I use and is working, once the specific word appears, it will call the Sub below:
The 3 checkboxes are in columns CX, CY and CZ, 24 in each column, so 72 checkboxes.
I would like to replace them by False/True hoping it elaviates the sluggishness.
Because my workbook is slowing down a lot due to the heavy amount of checkboxes I have, I want to see what the performances would be if I were to replace those checkboxes by a False/True statement according the number of times the specific word appears.
Here is the code I use and is working, once the specific word appears, it will call the Sub below:
VBA Code:
Sub TickCheckBox(rng As Range)
Dim CB As CheckBox, cb1 As CheckBox, cb2 As CheckBox, cb3 As CheckBox
r = rng.Row
With rng.Parent
For Each CB In rng.Parent.Checkboxes
Select Case CB.TopLeftCell.Address
Case .Cells(rng.Row, "CX").Address
Set cb1 = CB
Case .Cells(rng.Row, "CY").Address
Set cb2 = CB
Case .Cells(rng.Row, "CZ").Address
Set cb3 = CB
End Select
Next
If cb1.value = xlOff Then
cb1.value = xlOn
ElseIf cb2.value = xlOff Then
cb2.value = xlOn
ElseIf cb3.value = xlOff Then
cb3.value = xlOn
blnThreeFound = True
End If
End With
End Sub
The 3 checkboxes are in columns CX, CY and CZ, 24 in each column, so 72 checkboxes.
I would like to replace them by False/True hoping it elaviates the sluggishness.