Here's an alternative that uses a procedure within the userform to load the checkboxes, this saves repeating the code. Also, by using a consistent naming for the checkboxes, the original didn't, the code uses a loop to load them, reducing the lines of code. It also enables/disables the navigation buttons dependant on the row selected
Dim Rw As Long
Dim i As Long
'View Next Button
Private Sub cmdViewNext2_Click()
Rw = Rw + 1
Me.cmdViewPrev2.Enabled = True
If Rw = Sheets("Tracking").Cells(Rows.Count, 1).End(xlUp).Row Then Me.cmdViewNext2.Enabled = False
loadBoxes
End Sub
'View Previous Button
Private Sub cmdViewPrev2_Click()
Rw = Rw - 1
Me.cmdViewNext2.Enabled = True
If Rw = 1 Then
Me.cmdViewPrev2.Enabled = False
End If
loadBoxes
End Sub
Private Sub UserForm_Initialize()
Rw = 1
loadBoxes
Me.cmdViewPrev2.Enabled = False
End Sub
Sub loadBoxes()
With Sheets("Tracking")
For i = 1 To 11
Me("cbo" & i).Value = .Cells(Rw, i).Value
Next i
End With
End Sub
See example in later post
Bookmarks