Hello!
I am trying to add a row on a bottom of my table depending on what checkboxes are checked.
COLUMN B successfully pastes the checkbox caption but I want to add text on a specific cell with the same corresponding row of the checkbox that is checked.
I have this loop to check the true checkboxes:
For j = 0 To Me.Controls.Count - 1
If Left(Me.Controls(j).Name, 8) = "CheckBox" Then
If Me.Controls(j).Value = "True" Then
addRow = 26 + cbCount
newRange = CStr(addRow)
cbCount = cbCount + 1
Range("C" & newRange).Value = text1
End If
End If
Next j
and this code for the checkboxes:
Option Explicit
Dim text1 As String
Sub CheckBox20_Click()
If CheckBox20.Value = True Then
text1 = "JESD22 - A103"
End If
End Sub
Sub CheckBox21_Click()
If CheckBox20.Value = True Then
text1 = "12121212121"
End If
End Sub
The problem is that the result ends up like this:
ex.png
any help will be appreciated! thank you!
Bookmarks