AKK
06-24-2009, 09:21 AM
Hi all,
Working on a different macro now, but still getting the same 'Else without If' error (and I do have the 'End If' in there now). Am I missing something else equally obvious?
Thanks!
Sub OverdueCategories()
Dim dCurrentDate As Date
Dim iDaysOverdue As Integer
dCurrentDate = InputBox("Enter current date")
iDaysOverdue = dCurrentDate - Selection.Offset(0, 3)
Range("F4").Select
Do Until Selection.Value = ""
If Selection.Value = "Open" And iDaysOverdue > 90 Then Selection.Value = "Over 90 days overdue"
ElseIf Selection.Value = "Open" And iDaysOverdue > 60 Then Selection.Value = "Over 60 days overdue"
ElseIf Selection.Value = "Open" And iDaysOverdue > 30 Then Selection.Value = "Over 30 days overdue"
ElseIf Selection.Value = "Open" And iDaysOverdue <= 30 Then Selection.Value = "30 days overdue or less"
Else: Selection.Offset(1, 0).Select
End If
Loop
End Sub
Working on a different macro now, but still getting the same 'Else without If' error (and I do have the 'End If' in there now). Am I missing something else equally obvious?
Thanks!
Sub OverdueCategories()
Dim dCurrentDate As Date
Dim iDaysOverdue As Integer
dCurrentDate = InputBox("Enter current date")
iDaysOverdue = dCurrentDate - Selection.Offset(0, 3)
Range("F4").Select
Do Until Selection.Value = ""
If Selection.Value = "Open" And iDaysOverdue > 90 Then Selection.Value = "Over 90 days overdue"
ElseIf Selection.Value = "Open" And iDaysOverdue > 60 Then Selection.Value = "Over 60 days overdue"
ElseIf Selection.Value = "Open" And iDaysOverdue > 30 Then Selection.Value = "Over 30 days overdue"
ElseIf Selection.Value = "Open" And iDaysOverdue <= 30 Then Selection.Value = "30 days overdue or less"
Else: Selection.Offset(1, 0).Select
End If
Loop
End Sub