I can't figure out what this code keeps adding the data to the active sheet instead of the specified "Users" sheet:
Private Sub CommandButton1_Click()
With Sheets("Users")
eRow = Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Cells(eRow, 1) = Username.Value
Cells(eRow, 2) = Password.Text
End With
With Worksheets("Users").Range("A3")
If (Application.CountA(.EntireColumn) - 2) > 1 Then
Username.List = .Resize(Application.CountA(.EntireColumn) - 2).Value
Else
Username.AddItem .Value
End If
End With
Password.Value = ""
Username.ListIndex = -1
End Sub
Bookmarks