Macro procedures

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to record a macro which begins with a cell that I click on, and
the references up the same column 5 rows to complete a calculation. Once
finished it should move down 5 rows and repeat process. Can't make it not
reference specific cell. Any suggestions??
 
Sub AAA()
ActiveCell.FormulaR1C1 = "=Sum(R[-1]C:R[-4]C)"
ActiveCell.Offset(5, 0).Select
End Sub

assume you click in E5. and run the macro

It will put in the formula =Sum(E1:E4), then move to E10. Click again, it
will put in the sum
=Sum(E6:E9) then move to E15
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top