Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Insert new column and paste formula

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Insert new column and paste formula

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 Ward wrote:

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


--

Dave Peterson
Reply
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
Easy eay to copy / paste a formula in column watermt Excel Worksheet Functions 2 November 17th 09 03:22 PM
Find end of column and paste formula in range MGS Excel Worksheet Functions 2 August 25th 09 01:07 AM
? VBA to insert formula if a column is blank or not ? [email protected] Excel Programming 1 January 22nd 07 10:01 PM
Formula to look up a column and paste results in another column DM Excel Worksheet Functions 4 March 28th 06 07:36 PM
Same formula in each cell of column; insert rows w/o copying down tgdavis Excel Discussion (Misc queries) 3 September 14th 05 09:32 PM


All times are GMT +1. The time now is 11:23 AM.

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"