Can someone please help with the required code to add checkboxes to a worksheet, in Column A? I am able to add a checkbox to a cell in Column A, based on a value in column B. I am also able to delete all checkboxes, using code I found on the web. Where I fail is to be able to add a checkbox only if one does not already exist.
If a user inserts an extra row in the spreadsheet, it will of course not contain a checkbox. I would like my code to conditionally add a checkbox in the corresponding row, IF it does not already contain a checkbox. My code is not allowing me to do so, in spite of all my attempts. I suspect that the problem is in one of the rows shown below, as the code seems to keep looping back to the FIRST checkbox, then comparing its position with the position of the cell in the current looped row. It always compares the first checkbox, so of course, after the first looped row, it will always fail.
For Each chkbx In ActiveSheet.CheckBoxes
'Check if Cell in column B is not equal to nothing
If Cells(intRow, "B").Value <> "" Then
If Intersect(Range(chkbx.TopLeftCell.Address), Cells(intRow, 1)) Is Nothing Then
'do your stuff
These checkboxes are not being used in a form, rather they are placed in worksheet cells. The idea is that any rows (records) which contain a checked checkbox will be copied to another worksheet.
Thanks in advance for your consideration and help.
Bookmarks