Help with summation after macro executed

D

derekvho

I have a macro that I created that inserts rows. At the bottom of the
sheet, I have several summary rows that add the values of the inserted
rows according to what the header row is. My problem is that the
summary rows do not add the inserted rows after the macro has been
executed.

I was perhaps thinking of a SUMIF but that doesn't seem to work
effectively. Any ideas?


Thanks in advance,
Derek
 
B

Bob Phillips

Use a formula of

=SUM(A2:OFFSET(A99,-1,0)

assuming the total starts in A99

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
D

derekvho

Similar question...
Let's say you have a range of 5 cells (A231:A235). The 6th cell is a
summation cell (A236).
1. Highlight the entire 6th row
2. Right-click to insert a row and choose insert
3. In the summation cell (now A237), Excel will only add up the
original 5 rows.

Is there a way for Excel to add the inserted 6th cell's data in the new
summation cell (A237)?
 
B

Bob Phillips

Yes

=SUM(A231:OFFSET(A236,-1,0))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Top