Hello - I have the following macro and it is hanging up with a "next without for" compile error. I don't see what is wrong with it? Could someone please help me? It is hanging up on the line 'Next mycell".
Code:
Public Sub ProjNumbrReq()
'Call ProjNumbrReq
Dim myCell As Range
With Worksheets("Travel Expense Voucher")
If .Range("F5") = 2 Then
For Each myCell In .Range("W16:W46")
If myCell.Value > 0 And .Cells(myCell.row, "N") = "" Then
MsgBox "Project Number must be provided on each line where reimbursement is being claimed.", vbCritical, "Important:"
Exit Sub
Next myCell
End If
End With
End Sub
Last edited by a moderator: