IF statement failing

  • Thread starter Thread starter kimg
  • Start date Start date
K

kimg

I am attempting to get a macro to copy an IF() function using a
relative cell address

Range("K65536").End(xlUp)(1, 2).Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]<1000,""F"",""H"")"
Selection.Copy
Range(Selection, "L15").Select
ActiveSheet.Paste

I am expecting to see either F or H in the cells but I am seeing the
formula =IF(RC[-1]<1000,"F","H")
I suspect that the problem is something to do with the relative cell
reference as the function wizard in Excel claims this is "Invalid".
Two hours searching the archives has not proved fruitful.

I am frustratingly new to all this so any assistance would be much
appreciated.
 
Check first that the cell is not formatted as Text.
Otherwise check to see if:
Tools|Options.. View tab, that the Formulas checkbox is not checked.
 
Check first that the cell is not formatted as Text.
Otherwise check to see if:
Tools|Options.. View tab, that the Formulas checkbox is not checked.
--
p45cal



kimg said:
I am attempting to get a macro to copy an IF() function using a
relative cell address
Range("K65536").End(xlUp)(1, 2).Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]<1000,""F"",""H"")"
Selection.Copy
Range(Selection, "L15").Select
ActiveSheet.Paste
I am expecting to see either F or H in the cells but I am seeing the
formula =IF(RC[-1]<1000,"F","H")
I suspect that the problem is something to do with the relative cell
reference as the function wizard in Excel claims this is "Invalid".
Two hours searching the archives has not proved fruitful.
I am frustratingly new to all this so any assistance would be much
appreciated.- Hide quoted text -

- Show quoted text -

Thankyou for your reply. I had forced the formatting to text. Once
reformatted to General it worked! Boy, I have a lot to learn.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top