Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default excel macro-copy formula to entire column?

i have a large amount of data i need to graph each week. The amount of data
varies each week. I would like to have a macro which creates a formula and
puts it in an adjacent cell to all the rows with data. I have created macros
for this, but it always pastes the formula in the number of rows i had in the
spreadsheet when i created the macro.

For instance, when i record the macro i had 32000 rows. It pastes the
formula in rows 2-32,000. When i pul in new data with 31000 rows, it is still
pasting the formula in rows 2-32,000. How do I get the macro to only paste in
the relative rows?
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default excel macro-copy formula to entire column?

With your formula entered in C1..............

Sub Auto_Fill()
Dim Lrow As Long
With ActiveSheet
Lrow = Range("C" & Rows.Count).End(xlUp).Row
Range("C1:C" & Lrow).FillDown
End With
End Sub


Gord Dibben MS Excel MVP


On Fri, 9 Feb 2007 06:56:01 -0800, kfboudreau
wrote:

i have a large amount of data i need to graph each week. The amount of data
varies each week. I would like to have a macro which creates a formula and
puts it in an adjacent cell to all the rows with data. I have created macros
for this, but it always pastes the formula in the number of rows i had in the
spreadsheet when i created the macro.

For instance, when i record the macro i had 32000 rows. It pastes the
formula in rows 2-32,000. When i pul in new data with 31000 rows, it is still
pasting the formula in rows 2-32,000. How do I get the macro to only paste in
the relative rows?
Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default excel macro-copy formula to entire column?

Thanks for the assistance. It worked out great!

"kfboudreau" wrote:

i have a large amount of data i need to graph each week. The amount of data
varies each week. I would like to have a macro which creates a formula and
puts it in an adjacent cell to all the rows with data. I have created macros
for this, but it always pastes the formula in the number of rows i had in the
spreadsheet when i created the macro.

For instance, when i record the macro i had 32000 rows. It pastes the
formula in rows 2-32,000. When i pul in new data with 31000 rows, it is still
pasting the formula in rows 2-32,000. How do I get the macro to only paste in
the relative rows?
Thanks.

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
Need Macro Help excelmad Excel Discussion (Misc queries) 7 January 19th 07 10:04 PM
Is this possible with excel ? ChrisB Excel Discussion (Misc queries) 14 December 30th 06 12:31 AM
formula structure building ? check under the excel forum.... 4pinoy Excel Discussion (Misc queries) 2 November 16th 06 03:40 PM
copy and pasting a find all list into another column Ben Excel Discussion (Misc queries) 18 December 31st 05 10:51 PM
Copy one cell to entire column Tom Excel Discussion (Misc queries) 6 April 27th 05 11:39 PM


All times are GMT +1. The time now is 04:40 PM.

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

About Us

"It's about Microsoft Excel"