Varying rows formula


Posted by sjt on August 01, 2001 5:01 PM

I have a column (F) that needs to be summed. The formula needs to in column F right below the last row that is being summed. Each month, though, there will be a different amount of rows so the formula cell will vary. How can I write a macro that finds the last row in Column F and puts the formula in the cell right below it.

Example:
Month one Month two
F1= 2 F1=2
F2= 2 F2=2
F3= 2 F3=4(Sum)
F4= 6(sum)

Please Help!



Posted by Stephanie on August 01, 2001 5:56 PM

generally speaking, use the xldown command in vb. this relicates hitting ctrl+down arrow that takes you to the last cell in a block of cells. then just write the formula in the row below that.

specifically, the formula is different depending on if you have many chunks of rows for different months, or if this is something you recalculate every month