ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Nested If Then (https://www.excelbanter.com/excel-programming/304757-re-nested-if-then.html)

sp00nix[_5_]

Nested If Then
 
Try this:


Code
-------------------

Sub test()
' Inserts Early, On Time, or Late
Range("N2").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(0, 1).Select

'<start fix
' This is the only line I altered
' I removed the additional " 's from the end
'-------------------------------------------------------
ActiveCell.FormulaR1C1 = "=IF(RC[-1]5,""Early"",IF(RC[-1]=0,""On Time"",IF(RC[-1]<0,""Late"")))"
'-------------------------------------------------------
'</end fix

ActiveCell.Offset(1, -1).Select
End If
Loop Until IsEmpty(ActiveCell) = True

End Sub


-------------------


let me know how it goes
Mik

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 02:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com