Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This sub returns error 1004 when it hits the second if statement. Can
you tell me why? ------------ Sub addYears() Dim year1 As Integer Dim year2 As Integer For Each cell In Range("a1", "a3000") If cell.Value = cell.Offset(1, 0).Value Then year1 = cell.Offset(0, 4).Value year2 = cell.Offset(1, 4).Value cell.Offset(0, 5).Value = year1 + year2 Else If cell.Value = cell.Offset(-1, 0).Value Then cell.Offset(0, 5).Value = "See Above" End If End If Next cell ---------- Thanks -tom End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Nested If not returning correct values | Excel Discussion (Misc queries) | |||
nested IF(OR Vlookup returning zero instead of value in target cel | Excel Worksheet Functions | |||
Nested If statements returning a sum calculation | Excel Worksheet Functions | |||
Nested "if" not returning expected value | Excel Worksheet Functions | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming |