Hello,
I have made a userform with about 25 checkboxes. The userform's contents has information on it with regards to what is happening on the worksheet - within the row the user is currently on.
The checkboxes should populate true/false in the respective column of the row the user is on - depending on whether the box is ticked or unticked (of course!) [so each checkbox has its' own column - and the result is true/false for each of them.
To be clear - when the userform is brought up, the boxes should still be ticked/untick depending on what the sheet has written for that row (true/false).
However, this is taking me sometime to build up and I am wondering whether there is a quicker method.
I have had to build up the value of the checkbox in the "userform_activate" and then for each of the "Checkbox[number]_click, I have to update the spreadsheet with its' value. I appreciate that once I've done writing the code it's done and i won't have to go back to it (especially as I have 'named' each of the columns). Can I use a listbox or something else to quickly jump for one box to another?
An example of what I have had to do:
Then in the checkbox1 click:
Am I doing anything wrong here or is there a quicker method to this madness?
thank you!
I have made a userform with about 25 checkboxes. The userform's contents has information on it with regards to what is happening on the worksheet - within the row the user is currently on.
The checkboxes should populate true/false in the respective column of the row the user is on - depending on whether the box is ticked or unticked (of course!) [so each checkbox has its' own column - and the result is true/false for each of them.
To be clear - when the userform is brought up, the boxes should still be ticked/untick depending on what the sheet has written for that row (true/false).
However, this is taking me sometime to build up and I am wondering whether there is a quicker method.
I have had to build up the value of the checkbox in the "userform_activate" and then for each of the "Checkbox[number]_click, I have to update the spreadsheet with its' value. I appreciate that once I've done writing the code it's done and i won't have to go back to it (especially as I have 'named' each of the columns). Can I use a listbox or something else to quickly jump for one box to another?
An example of what I have had to do:
VBA Code:
Private Sub UserForm_Activate()
Dim RowNumber As Integer, Alpha As String
With Activecell
RowNumber = .Row
Alpha= ActiveSheet.Cells(.Row, Range("Alpha").Column)
Checkbox1 =Alpha
End with
End sub
Then in the checkbox1 click:
VBA Code:
Private Sub CheckBox1_Click()
Dim RowNumber As Integer, ColNumber As Integer
With ActiveCell
RowNumber = .Row
End With
With Range("Alpha")
ColNumber = .Column
End With
Cells(RowNumber, ColNumber).Value = Checkbox1.Value
Am I doing anything wrong here or is there a quicker method to this madness?
thank you!