Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding sums in rows and columns and colouring cells with condition | Excel Discussion (Misc queries) | |||
deleting rows messing up formulas | Excel Discussion (Misc queries) | |||
Sums & Deleting Columns | Excel Discussion (Misc queries) | |||
Rows containing "#N/A" are messing with my formulas, please help | Excel Worksheet Functions | |||
Moving Column Sums to Rows | Excel Discussion (Misc queries) |