next
02-20-2008, 12:48 PM
For Each x In Range("B:B")
If x.Row > LastCell Then: Exit For
If IsEmpty(x.Value) Then: x.Value = "30"
If IsNumber(x.Value) Then
Select Case (x.Value)
Case 0 To 20: TotalPastDue = TotalPastDue + Range("L" & x.Row) _
- Range("C" & x.Row) - Range("D" & x.Row)
Case 20 To 30: TotalPastDue = TotalPastDue + Range("L" & x.Row) _
- Range("C" & x.Row) - Range("D" & x.Row) - Range("E" & x.Row)
Case 30 To 45: TotalPastDue = TotalPastDue + Range("L" & x.Row) _
- Range("C" & x.Row) - Range("D" & x.Row) - Range("E" & x.Row) - Range("F" & x.Row) _
- Range("G" & x.Row)
Case 45 To 120: TotalPastDue = TotalPastDue + Range("L" & x.Row)
End Select
Next x
For some reason IsNumber brings up an error message saying "Sub or Function not defined.". What am i doing wrong?
If x.Row > LastCell Then: Exit For
If IsEmpty(x.Value) Then: x.Value = "30"
If IsNumber(x.Value) Then
Select Case (x.Value)
Case 0 To 20: TotalPastDue = TotalPastDue + Range("L" & x.Row) _
- Range("C" & x.Row) - Range("D" & x.Row)
Case 20 To 30: TotalPastDue = TotalPastDue + Range("L" & x.Row) _
- Range("C" & x.Row) - Range("D" & x.Row) - Range("E" & x.Row)
Case 30 To 45: TotalPastDue = TotalPastDue + Range("L" & x.Row) _
- Range("C" & x.Row) - Range("D" & x.Row) - Range("E" & x.Row) - Range("F" & x.Row) _
- Range("G" & x.Row)
Case 45 To 120: TotalPastDue = TotalPastDue + Range("L" & x.Row)
End Select
Next x
For some reason IsNumber brings up an error message saying "Sub or Function not defined.". What am i doing wrong?