Copy formula down

  • Thread starter Thread starter PCOR
  • Start date Start date
P

PCOR

I would like to place a formula in a cell(not always the same cell but where
the cursor is located) then copy that formula down to as little 25 and to
a max of 1000 cells below(The end of copy is variable.)
Thanks
 
PCOR

What determines the variable?

If it is the data in an adjacent column, just double-click on the fill-handle
of the cell with the formula to fill down to end of data in the adjacent
column.

Fill-handle is the little black square on the lower-right corner of the cell.

If variable is something else, post back. You will probably need code.

Gord Dibben XL2002
 
May be word variable is misleading.
Some days I will have to copy the formula down 25 cells others 300 and other
could be 1000
It may never be the same
Thanks
 
PCOR

Still short on details.

How would you(or anyone) know when it should be 25, 300 or 1000?

There has to be some type of determining factor as in "if the dog barks twice,
copy down 25 cells" or "if I get lucky tonight copy down 300 cells"

Gord
 
Ian

How about VBA?

Sub copydown()
Dim Lrow As Long
Lastrow = Range("A" & Rows.Count).End(xlUp).Row
Range("B1:C" & Lastrow).FillDown
End Sub

Will copy formulas in B1 and C1 down as far as you have data in Column A

Gord
 
Thanks. That look good.BUT I could use a small change....
How would I go about using this VBA code so that the formula would be copied
to any two col to the right of the selected column.

Ian
Ian

How about VBA?

Sub copydown()
Dim Lrow As Long
Lastrow = Range("A" & Rows.Count).End(xlUp).Row
Range("B1:C" & Lastrow).FillDown
End Sub

Will copy formulas in B1 and C1 down as far as you have data in Column A

Gord

No dog lol
It would depend on how many entries there were on any given days.
Ian
Gord Dibben said:
PCOR

Still short on details.

How would you(or anyone) know when it should be 25, 300 or 1000?

There has to be some type of determining factor as in "if the dog barks twice,
copy down 25 cells" or "if I get lucky tonight copy down 300 cells"

Gord


May be word variable is misleading.
Some days I will have to copy the formula down 25 cells others 300 and other
could be 1000
It may never be the same
Thanks

"Gord Dibben" <gorddibbATshawDOTca> wrote in message
PCOR

What determines the variable?

If it is the data in an adjacent column, just double-click on the
fill-handle
of the cell with the formula to fill down to end of data in the adjacent
column.

Fill-handle is the little black square on the lower-right corner of the
cell.

If variable is something else, post back. You will probably need code.

Gord Dibben XL2002
 
Back
Top