Insert new column and paste formula

  • Thread starter Thread starter Judy Ward
  • Start date Start date
J

Judy Ward

I have read posts about pasting a formula into a column that already has data
by using, for example:
Range("L2:L" & Range("L65536").End(xlUp).Row).FormulaR1C1 =
"=SUM(RC[1]:RC[38]"
This isn't working for me because my column does not have any data in it
(inserting the column is part of my code).

All the other columns in the spreadsheet have data, but not this newly
inserted column. Can anyone help me with pasting my formula into the column
only for the rows that have data?

Thank you for any help you can give me,
Judy
 
Maybe you could just fill the range with a formula that looks blank if there is
no data???

.formular1c1 = "=if(count(RC[1]:RC[38])=0,"""",SUM(RC[1]:RC[38]))"

(and watch your )'s--you were missing that last one.


Judy said:
I have read posts about pasting a formula into a column that already has data
by using, for example:
Range("L2:L" & Range("L65536").End(xlUp).Row).FormulaR1C1 =
"=SUM(RC[1]:RC[38]"
This isn't working for me because my column does not have any data in it
(inserting the column is part of my code).

All the other columns in the spreadsheet have data, but not this newly
inserted column. Can anyone help me with pasting my formula into the column
only for the rows that have data?

Thank you for any help you can give me,
Judy
 

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