Still trying to fix this... here's where I'm at for the delete command button:
Private Sub DelEmp_Click()
Dim answer As VbMsgBoxResult
Dim c As Long
Dim rngDelEmpList As Range
On Error Resume Next
If cbo5.Value = "Former Employee" Then
MsgBox "You cannot delete a 'Former Employee.'"
End If
If cbo5.Value = "" Then
MsgBox "No employee selected."
Else
answer = MsgBox("Are you sure you want to delete " & cbo5.Value & "?", vbYesNo + vbExclamation, "Delete Employee")
If answer = vbYes Then
With ws3
Worksheets("Data").Range("EmpNameData").Replace _
what:=cbo5.Value, Replacement:="Former Employee", _
SearchOrder:=xlByColumns
End With
c = Worksheets("Administrative Menu").Range("B3").CurrentRegion.Rows.Count
Set Found = Worksheets("Administrative Menu").Columns("B").Find(what = Me.cbo5.Value, LookIn:=xlValues, lookat:=xlWhole)
Found.Delete (xlShiftUp)
MsgBox cbo5.Value & " has been deleted."
Unload Me
End If
End If
End Sub
Any help is greatly appreciated.
Bookmarks