Using a Macro to copy a formula into last active row
Hi I am recording a Macro which carries out various procedures on a file which is downloaded weekly and in which the number of rows various. One part of the macro is to run an If Statement in column G which once generated I want to copy down the remaining active cells in column G which varies each time the file is downloaded. Is there any way I can get the results of the If statement only to fill down active rows or do I need to copy it the whole length of the worksheet and then delete all the surplus rows. Thanks Shirley Munro -- Shirley Munro ------------------------------------------------------------------------ Shirley Munro's Profile: http://www.excelforum.com/member.php...nfo&userid=836 View this thread: http://www.excelforum.com/showthread...hreadid=509950 |
Using a Macro to copy a formula into last active row
The exact mechanics of doing this depend on where your data is and how to
determine the row count. But if I assume that the data starts in G1 and you want to fill down to the last active row in the sheet, this is one way: Range("G1").Resize(ActiveSheet.UsedRange.Rows.Coun t).FillDown -- Jim "Shirley Munro" wrote in message news:Shirley.Munro.22wni0_1139392805.8743@excelfor um-nospam.com... | | Hi | | I am recording a Macro which carries out various procedures on a file | which is downloaded weekly and in which the number of rows various. | One part of the macro is to run an If Statement in column G which once | generated I want to copy down the remaining active cells in column G | which varies each time the file is downloaded. Is there any way I can | get the results of the If statement only to fill down active rows or do | I need to copy it the whole length of the worksheet and then delete all | the surplus rows. | | Thanks | | Shirley Munro | | | -- | Shirley Munro | ------------------------------------------------------------------------ | Shirley Munro's Profile: http://www.excelforum.com/member.php...nfo&userid=836 | View this thread: http://www.excelforum.com/showthread...hreadid=509950 | |
All times are GMT +1. The time now is 01:10 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com