In my worksheet, the range A3:A7 are employess and the range B3:E7 are monthly sales from January - April for each employee. I keep getting an error "Run-time error '1004' for the code below at "LowestEmployeeSales = ":
Private Sub cmdAnswerEmployLowestSales_Click()
Dim LowestEmployeeSales As String
Dim LowestEmployee As String
LowestEmployeeh = Application.InputBox("Enter Answer", "Lowest Employee", Type:=2)
LowestEmployeeSales = WorksheetFunction.Index(Range("A3:A7"), _
If LowestEmployee <> LowestEmployeeSales Then
MsgBox "Incorrect answer " & LowestEmployeeMonth & " does not have the lowest month sales. Try Again!"
MsgBox "Correct Answer - great job!"
What I am trying to do is ask the question "Which employee has the lowest sales from January - April?" using the MIN function