LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Nested If Then

ActiveCell.FormulaR1C1 = _
"=IF(RC[-1]5,""Early"",IF(RC[-1]=0,""On Time"",IF(RC[-1]<0,""Late"")))"

worked for me.

--
Regards,
Tom Ogilvy

"jmdaniel" wrote in message
...
I am trying to return the words "Early, "Late", or "On Time" to a column

of cells, depending on what the value was in the column just to the left. It
worked great when I used the macro recorder to just test for one condition,
and return one of two possibilities, but when I tried to nest all the
possibilities, I get an error on the Active Cell.Formula line. The debug
help isn't, so I thought I would ask if I have this line written correctly.
Thanks!

' Inserts Early, On Time, or Late
Range("N2").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]5,""Early"",IF(RC[-1]=0,""On

Time"",IF(RC[-1]<0,""Late"")))"""
ActiveCell.Offset(1, -1).Select
End If
Loop Until IsEmpty(ActiveCell) = True



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
nested If Dave Shultz Excel Discussion (Misc queries) 3 March 3rd 09 05:52 PM
Nested IFs lwilliams Excel Worksheet Functions 6 August 12th 08 04:16 PM
Nested IF with a possible SUM? Princessl210 Excel Discussion (Misc queries) 1 April 8th 08 07:56 AM
nested if based on nested if in seperate sheet. how? scouserabbit Excel Worksheet Functions 5 March 2nd 07 04:03 PM
What is quicker? Nested or non nested ifs andycharger[_17_] Excel Programming 2 February 25th 04 03:58 PM


All times are GMT +1. The time now is 11:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"