Need an auto update formula macro

  • Thread starter Thread starter foxspirit
  • Start date Start date
F

foxspirit

Here's the sheet.

cell A40=SUM(E41:*E54*)
cell C43=SUM(*E55*:E80)
cell I45=current #
cell I47=prior #

I want to be able to run a macro that will do in this ORDER the
following logical steps:

If I47 = I45
then updated A40's formula to "=sum(E41:*E55*)"
then update C43's formula to "=sum(*E56*:E80)
Else copy I45's # and paste into I47
then updated A40's formula to "=sum(E41:*E55*)"
then update C43's formula to "=sum(*E56*:E80)

Basically its just moving the cell ranges forward one for me as shown
by the bolding. Anybody know how I can do this?
 
Is it possible to refer to the cells by cell name (lets say I name A40
Bob) when doing this so it doesn't matter if I move cell A40 to D5,
because the macro will search for its name "Bob" instead?
 
How about this...could somebody just tell me how to write code that
refers to a named cell. I want my code to know use Bob like you would
use a static cell reference. How do you declare that? Am I making no
sense? I apologize because I'm just starting out and learning as I go.
 
Back
Top