Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Fill formula down using macro
hi, using VBA I would like to fill a formula down to end of my data rather
than to a fixed cell as the size of my data is different each time I run my macro. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Fill formula down using macro
Const formulaStartingCell As String = "C2"
Dim lastrow As Long 'replace A to the column that will always be the last row lastrow = Range("A" & Rows.Count).End(xlUp).Row Range(formulaStartingCell).Activate Selection.AutoFill Destination:=Range(formulaStartingCell & ":C" & lastrow), Type:=xlFillDefault "Charles" wrote: hi, using VBA I would like to fill a formula down to end of my data rather than to a fixed cell as the size of my data is different each time I run my macro. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Fill formula down using macro
Hi,
Here is one example which puts the formula in all the cells LastCell = [A1].End(xlDown).Row Range([B1], "B" & LastCell) = "=COUNTIF(INDIRECT(R1C&""!A1:D10""),RC1)" Note this is not a fill down command it puts the formula of interest in all the cells indicated. Cheers, Shane Devenshire "Charles" wrote: hi, using VBA I would like to fill a formula down to end of my data rather than to a fixed cell as the size of my data is different each time I run my macro. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Formula for counting rows and doing a fill in afterwards | Excel Worksheet Functions | |||
Copy or Fill Down Macro? | Excel Discussion (Misc queries) | |||
Fill Blanks Macro | Excel Discussion (Misc queries) | |||
Macro or Custom button to fill in the same formula | Excel Worksheet Functions | |||
Fill Formula - Macro | Excel Discussion (Misc queries) |