ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Fill down based on rows in region (https://www.excelbanter.com/excel-programming/278032-fill-down-based-rows-region.html)

ronber

Fill down based on rows in region
 
Suppose data in A1:F1 and in A1:Asome number

I want to fill code starting in E2 down to Esomenumber.

Suppose the formula is "=MyCode"

How do I go about doing that, given the number of rows may vary and I
want the code to adapt to the number of rows?

TIA
Ron



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Trevor Shuttleworth

Fill down based on rows in region
 
Ron

Dim LastRow As Long
LastRow = Range("A65536").End(xlUp).Row
Range("E2:E" & LastRow).Formula = "=MyCode"

Regards

Trevor


"ronber" wrote in message
...
Suppose data in A1:F1 and in A1:Asome number

I want to fill code starting in E2 down to Esomenumber.

Suppose the formula is "=MyCode"

How do I go about doing that, given the number of rows may vary and I
want the code to adapt to the number of rows?

TIA
Ron



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 01:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com