![]() |
help with macro to delete entries in a table
hi all, I have a spreadsheet that contains the copied and pasted contents of a pivot table. the data has lost its pivot properties so can be manipulated as desired. I have attached a simple worksheet outlining the problem in the zip file. what I need to do is go through the 'table' and examine each pivot 'group' (by group I mean where is totals up a field so you have "field one" and "field one total") If you look in the attached spreadsheet, you can see "Committed Projects" in A9. to the right of that you can see (moving down) 6 cells of data and to the right of them a value in column C. I have to go through and delete any rows that have a '0' in C. with this examlpe though, you can see that everything has a zero in apart from C14. I still need to keep the grouping, "Committed Projects" and "committed projects total", so i'd need to shift the contents of C14 up to be C9 does this make sense? can anybody suggest a way to do this? previously I was using the following: Code: -------------------- For iRow = Range("C65536").End(xlUp).Row To 5 Step -1 If Range("C" & iRow).Value = 0 Then Range("C" & iRow).EntireRow.Delete End If Next -------------------- but this would then leave funny looking results as row 9 would have been deleted. thanks in advance, Matt +-------------------------------------------------------------------+ |Filename: exceltip.zip | |Download: http://www.excelforum.com/attachment.php?postid=4518 | +-------------------------------------------------------------------+ -- matpj ------------------------------------------------------------------------ matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076 View this thread: http://www.excelforum.com/showthread...hreadid=526021 |
All times are GMT +1. The time now is 11:48 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com