Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
I would like to have a macro to copy a range of formulas in row 2 down for
all lines of input in an adjacent range. For example: Input Formula Row 2 Cell X2 Cell Y2 Row 3 Row 4 Row 5 In input date in the range Row2 through Row 5. I want to copy the formulas in Cells X2 and Y2 down for the other three lines of input. Thanks for any help that you can provide. |
#2
![]() |
|||
|
|||
![]()
Hmmm. What column gets the dates?
Option Explicit Sub testme01() Dim LastRow As Long Dim FirstRow As Long With ActiveSheet FirstRow = 2 'headers in row 1? LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row 'I used column A. .Range(.Cells(FirstRow, "C"), .Cells(LastRow, "C")).FormulaR1C1 _ = .Cells(FirstRow, "C").FormulaR1C1 .Range(.Cells(FirstRow, "d"), .Cells(LastRow, "d")).FormulaR1C1 _ = .Cells(FirstRow, "d").FormulaR1C1 End With End Sub lh wrote: I would like to have a macro to copy a range of formulas in row 2 down for all lines of input in an adjacent range. For example: Input Formula Row 2 Cell X2 Cell Y2 Row 3 Row 4 Row 5 In input date in the range Row2 through Row 5. I want to copy the formulas in Cells X2 and Y2 down for the other three lines of input. Thanks for any help that you can provide. -- Dave Peterson |
#3
![]() |
|||
|
|||
![]()
Dave,
This worked great. Thanks. Lori "Dave Peterson" wrote: Hmmm. What column gets the dates? Option Explicit Sub testme01() Dim LastRow As Long Dim FirstRow As Long With ActiveSheet FirstRow = 2 'headers in row 1? LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row 'I used column A. .Range(.Cells(FirstRow, "C"), .Cells(LastRow, "C")).FormulaR1C1 _ = .Cells(FirstRow, "C").FormulaR1C1 .Range(.Cells(FirstRow, "d"), .Cells(LastRow, "d")).FormulaR1C1 _ = .Cells(FirstRow, "d").FormulaR1C1 End With End Sub lh wrote: I would like to have a macro to copy a range of formulas in row 2 down for all lines of input in an adjacent range. For example: Input Formula Row 2 Cell X2 Cell Y2 Row 3 Row 4 Row 5 In input date in the range Row2 through Row 5. I want to copy the formulas in Cells X2 and Y2 down for the other three lines of input. Thanks for any help that you can provide. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data Range Mess | Charts and Charting in Excel | |||
Macro to search for and display data in another worksheet | Excel Worksheet Functions | |||
Copy range of cells omitting formulas that result in " " | Excel Discussion (Misc queries) | |||
Sort pages? | Excel Discussion (Misc queries) | |||
Weekly Transaction Processing | Excel Worksheet Functions |