PDA

View Full Version : [SOLVED] Checkbox populated by worksheet cells via userform



Loss1003
03-31-2016, 08:50 AM
I’m having difficulty with checkbox fields populated by worksheet cells via userform.
The userform retrieves the data except for the checkbox data. and If i click on a checkbox or mutliple checkboxes on that record and then move to another record (row) the checkboxes will remain checked. Please help fix the code.:friends:


Private Sub GetData()
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False

Dim rn As Range


If LCfile.Text <> "" Then

Set rn = Sheet2.Range("B2", Sheet2.Range("B2").End(xlDown)).Find(LCfile.Value, _
, , xlWhole, , xlNext)

If Not rn Is Nothing Then
Set rn = rn.Offset(0, -1)
DisableSave


If rn.Offset(0, 24) = "X" Then
General.Value = True
End If
If rn.Offset(0, 25) = "X" Then
Onsite.Value = True
End If
If rn.Offset(0, 26) = "X" Then
Phone.Value = True
End If
If rn.Offset(0, 27) = "X" Then
Desktop.Value = True
End If
If rn.Offset(0, 28) = "X" Then
Switch1.Value = True
End If
If rn.Offset(0, 29) = "X" Then
UserForm1.Acname1.Value = rn.Offset(0, 0)
UserForm1.LCfile.Value = rn.Offset(0, 1)
UserForm1.Abbrv1.Value = rn.Offset(0, 2)
UserForm1.Year1.Value = rn.Offset(0, 3)
UserForm1.Pol1.Value = rn.Offset(0, 4)
UserForm1.Sub1.Value = rn.Offset(0, 5)
UserForm1.Loc1.Value = rn.Offset(0, 6)
Loc1.Value = Format(Loc1.Value, "00#")
UserForm1.Dept1.Value = rn.Offset(0, 7)
UserForm1.enter1.Value = rn.Offset(0, 8)
UserForm1.Month1.Value = rn.Offset(0, 9)
UserForm1.Order1.Value = rn.Offset(0, 10)


UserForm1.RowNumber.Value = LCfile.Value + 1

End If

End If

Set rn = Nothing
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic