Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default deleting rows messing up sums

I have a worksheet that uses macros to pull data from other sheets within the
workbook. One of the macros deletes any rows with a zero value after the data
is pulled in - the number of rows varies each time. I need to subtotal and
then total the $$ amount from three sections after the macros have run. The
sum formulas that I have on the sheet get messed up each time. How do I
resolve this?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default deleting rows messing up sums

Are you using absolute references in your formulas eg $A$4 rather than
A4?

If the problem you are having relates to formulas in the row after the
one you delete, as a quick and simple solution you could add this line
after the one that deletes your rows;

cells(activerow,columnwithformulasin).formular1c1 =
cells(activerow-1,columnwithformulasin).formula

where activerow is the row after the one that has been deleted
(presumably the one with error formula) and columnwithformulas in is a
number relating to the columm your totals are in, ,eg column E = 5

Please be more specific with regards your formulas if this is not
relevant.
Cheers.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default deleting rows messing up sums

Hi ......,

Without the formulas that you are using and an example of what happens
I expect that you are talking about problems with a running balance
being dependent on the previous row which got deleted or missed
an inserted row in the running balance. If that is the case you want
to use OFFSET see
http://www.mvps.org/dmcritchie/excel/offset.htm
http://www.mvps.org/dmcritchie/excel/insrtrow.htm

This would also apply the the final total, if you delete the row before
the total or insert a row immediately before the total.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"pywhacket" wrote in message ...
I have a worksheet that uses macros to pull data from other sheets within the
workbook. One of the macros deletes any rows with a zero value after the data
is pulled in - the number of rows varies each time. I need to subtotal and
then total the $$ amount from three sections after the macros have run. The
sum formulas that I have on the sheet get messed up each time. How do I
resolve this?

Thanks!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding sums in rows and columns and colouring cells with condition Manosh Excel Discussion (Misc queries) 2 June 4th 09 06:09 AM
deleting rows messing up formulas Chad Excel Discussion (Misc queries) 2 January 30th 09 06:19 AM
Sums & Deleting Columns Duncs Excel Discussion (Misc queries) 2 December 4th 06 11:56 AM
Rows containing "#N/A" are messing with my formulas, please help Sam Excel Worksheet Functions 1 May 17th 05 04:47 PM
Moving Column Sums to Rows Roger PB Excel Discussion (Misc queries) 6 March 26th 05 03:09 PM


All times are GMT +1. The time now is 06:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"