Fairly Simple Macro HELP!

  • Thread starter Thread starter Lost
  • Start date Start date
L

Lost

I need a macro that does the following:

Each row consists of an item (therefore the number of rows will vary), I
need to drag a formula down a column (dragged down depending on the number of
items are entered in) through the last item. Then I need a sum on those
totals.

Please help! Thanks!
 
Hi,

I think you right it probably is a 'simple macro' if a macro is even
necessary but I'm afraid I don't understand the question
Each row consists of an item (therefore the number of rows will vary),

Please explain the above a bit more clearly and perhaps a small sample of
data with the answer you expect.

Mike
 
I need to drag a formula down a column

Besides Mike's question, tell us the formula you need to drag down so we can
show you how to construct it in code (and make sure to tell us which, if
any, references are absolute).
 
if your data is in column C and the first formula is in D1
then you could use

Range("D1").AutoFill Destination:=Range(Range("C1"),
Range("C1").End(xlDown)).Offset(, 1)
Range("D1").End(xlDown).Offset(1).FormulaR1C1 = "=SUM(R1C:R[-1]C)"
 
Back
Top