Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Kimberley
I approach this slightly differently. First find you last used row and then insert the required formula into all cells in the column base on this last row. This means you do not need to use the Autofill. e.g. Dim endRow As Long endRow = Range("E" & Rows.Count).End(xlUp).Row Range(Cells(2, 6), Cells(endRow, 6)).FormulaR1C1 _ = "=RC[-2]+RC[-3]" Hope this helps Rowan "TrainingGoddess" wrote: Sub AutoFillDateLookups() Dim DataRange As Range Dim CopyRange As Range Dim FillRange As Range Set DataRange = Range("ClassCountRevenue") Set CopyRange = Range("F2") Set FillRange = CopyRange.Offset(1, 0).Resize(DataRange.Rows.Count, 0).Select CopyRange.AutoFill Destination:=Range(FillRange) End Sub I am attempting to AutoFill a range of values from one cell (F2) to a range of cells below where the number of rows will vary from month to month. In the example above, I have set the datarange to capture the total rows/columns in the data table. I set the copy range to the starting cell containing my formula. I can't seem to get the fill range to be one row down and then resize to the total count of rows in the data table. Any help would be much appreciated. Thanks! Kimberly |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks for your help! *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA code to count rows | Excel Worksheet Functions | |||
Autofill cell references with a pattern of every 110 rows | Excel Worksheet Functions | |||
How do I count rows within a cell? | Excel Worksheet Functions | |||
excel deleting rows last cell does not change. How to change? | Excel Discussion (Misc queries) | |||
run code after cell contents change | Excel Programming |