okay, so I constructed a loop to populate a range of cells based on the value of checkboxes in a userform.
Now I'm trying to do the reverse.
have the userform on activation mark the checkboxes according to the range it filled prior.
Here is the working loop from form to worksheet:
Now I've tried numerous strategies to get the reverse to work but so far no dice... here is my current attempt:
I initially was trying to do a case statement, but couldn't get it to loop so I had to change it to "if's"
any help would be greatly appreciated!
Now I'm trying to do the reverse.
have the userform on activation mark the checkboxes according to the range it filled prior.
Here is the working loop from form to worksheet:
Code:
Dim k As IntegerFor k = 1 To 3
editrow = Application.Match(Sheets("Sheet2").Range("H1"), Sheets("Sheet2").Range("A:A"), 0)
nextc = Sheets("Sheet2").Cells(editrow, Columns.Count).End(xlToLeft).Column + 1
If UserForm1.Controls("Checkbox" & k).Value = False Then Sheets("sheet2").Cells(editrow, nextc).Value = UserForm1.Controls("Checkbox" & k).Name
Next k
end sub
Now I've tried numerous strategies to get the reverse to work but so far no dice... here is my current attempt:
Code:
Private Sub UserForm_Activate()Dim counter As Integer
ComboBox1.Value = Sheets("Sheet2").Range("H1")
editrow = Application.Match(Sheets("Sheet2").Range("H1"), Sheets("Sheet2").Range("A:A"), 0)
nextc = Sheets("Sheet2").Cells(editrow, Columns.Count).End(xlToLeft).Column + 1
For counter = 1 To 3
Set curCell = Sheets("Sheet2").Cells(editrow, counter + 1)
If curCell = "Checkbox1" Then
CheckBox1.Value = False
ElseIf curCell = "Checkbox2" Then
CheckBox2.Value = False
ElseIf curCell = "Checkbox3" Then
CheckBox3.Value = False
End If
Next counter
On Error GoTo getout
getout:
End Sub
I initially was trying to do a case statement, but couldn't get it to loop so I had to change it to "if's"
any help would be greatly appreciated!