I am having difficulty with a long if then else statement. The data in Column A is a GL account number. If cell AC4 contains the word False and If the account number is LT 34000 but GT 34288 but LT 36000 but GT 36288 and not equal to 36290, 36292, 36295, 36296 or 36298 then return No, Else Vlookup the account number from A1 to another spreadsheet. The problem is that it is always returning No as the answer and not doing the Vlookup on the accounts that it should be. Any help would be greatly appreciated. I have a feeling that it has to do with the RC1 designation.
Sub Temp()
'
' Temp Macro
'
'
Dim x As Long
For x = 1 To 1944
If Range("AC4").Value <> False And Range("RC1").Value < 34000 Or Range("RC1").Value > 34288 Or Range("RC1").Value < 36000 Or Range("RC1").Value > 36288 Or Range("RC1").Value <> 36290 Or Range("RC1").Value <> 36292 Or Range("RC1").Value <> 36295 Or Range("RC1").Value <> 36296 Or Range("RC1").Value <> 36298 Then
ActiveCell.FormulaR1C1 = "No"
Else
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC24,Mapping!R2C4:R1200C4,1,FALSE))"
End If
ActiveCell.Offset(1, 0).Activate
Next x
End Sub
Sub Temp()
'
' Temp Macro
'
'
Dim x As Long
For x = 1 To 1944
If Range("AC4").Value <> False And Range("RC1").Value < 34000 Or Range("RC1").Value > 34288 Or Range("RC1").Value < 36000 Or Range("RC1").Value > 36288 Or Range("RC1").Value <> 36290 Or Range("RC1").Value <> 36292 Or Range("RC1").Value <> 36295 Or Range("RC1").Value <> 36296 Or Range("RC1").Value <> 36298 Then
ActiveCell.FormulaR1C1 = "No"
Else
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC24,Mapping!R2C4:R1200C4,1,FALSE))"
End If
ActiveCell.Offset(1, 0).Activate
Next x
End Sub