CrispyAsian
Board Regular
- Joined
- Sep 22, 2017
- Messages
- 64
Hello everyone,
I am having an issue with ActiveX Checkboxes but I don't know what the problem is or how to fix it. So I have a sheet like this:
[/URL][/IMG]
And I have a code running to make everyone in column B have their own sheet. However, I only want that to happen if the checkbox in column A is checked. So far I have this running:
I ran through it and it never makes it past the line in red. It just jumps down to the End If. Does anybody know what I'm doing wrong?
I am having an issue with ActiveX Checkboxes but I don't know what the problem is or how to fix it. So I have a sheet like this:
And I have a code running to make everyone in column B have their own sheet. However, I only want that to happen if the checkbox in column A is checked. So far I have this running:
Code:
Sub Exampleofmycode
Dim objControl As Object
Dim lastrow As String
ThisWorkbook.Sheets("Personnel").Activate
lastrow = ActiveSheet.Columns("B").Cells.Find("*", SearchOrder:=xlByRows, LookIn:=xlValues, SearchDirection:=xlPrevious).Row
For Each c In ThisWorkbook.Sheets("Personnel").Range("B3:B" & lastrow)
If c.Value <> "" Then
For Each objControl In Sheets("Personnel").OLEObjects
If TypeName(objControl.Object) = "CheckBox" Then
[COLOR=#ff0000] If objControl.TopLeftCell.Row = c.Row Then[/COLOR]
If objControl.Object.Value = 1 Then
'Rest of the code goes here
End If
End If
End If
Next
End If
Next c
End Sub
I ran through it and it never makes it past the line in red. It just jumps down to the End If. Does anybody know what I'm doing wrong?
Last edited: