Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I am extracting data from a database into Excel. My colums are constant, but
number of rows vary. I need to copy a formula from AC2 down to the last row in that column. Thanks for the help! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Try this small macro:
Sub CopyFormula() Dim nLastRow As Long, destynation As String Set r = ActiveSheet.UsedRange nLastRow = r.Rows.Count + r.Row - 1 destynation = "AC3:AC" & nLastRow Range("AC2").Copy Range(destynation) End Sub -- Gary''s Student - gsnu200901 "MGS" wrote: I am extracting data from a database into Excel. My colums are constant, but number of rows vary. I need to copy a formula from AC2 down to the last row in that column. Thanks for the help! |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Will the formula already be in AC2?
Is there any adjacent column that will extend to last row? I will assume there is a formula and use column AB to determine last row. Sub Auto_Fill() Dim Lrow As Long With ActiveSheet Lrow = .Range("AB" & Rows.Count).End(xlUp).Row .Range("AC2:AC" & Lrow).FillDown End With End Sub Gord Dibben MS Excel MVP On Mon, 24 Aug 2009 16:06:02 -0700, MGS wrote: I am extracting data from a database into Excel. My colums are constant, but number of rows vary. I need to copy a formula from AC2 down to the last row in that column. Thanks for the help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
A macro to copy & paste many rows (a range) to the next column .. | New Users to Excel | |||
Find last column, move formulas over, copy/paste data | Excel Worksheet Functions | |||
find and paste formula | Excel Worksheet Functions | |||
Macro to find text string in a column and paste data in another | Excel Discussion (Misc queries) | |||
I need a formula to find rows within a date range in one column? | Excel Worksheet Functions |