View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Neon520 Neon520 is offline
external usenet poster
 
Posts: 129
Default Delete Rows Based on highlighted Color

Thank you for your clarification.
One strange thing I notice when I run the code, not quite follow your
explanation.
After running the code, I do a save as to compare the result. Let's say Row
2 is highlighted in RED and RED is the color I selected when prompt,
according to your explanation, the Entire row 2 should be deleted and Row 3
that is in YELLOW should move up Row 2. But what happen was Row 3 move to Row
2 as well as other subsequent rows, but the ONLY the columns with data (let's
say A-D) stay in YELLOW and the rest of the columns from E on are in RED. Can
you explain this strange outcome? Could AutoFilter play any role in this?

One more curious question if you don't mind.
If the data in Excel is not uniform, is it possible to write a code to copy
the data and put them back on a unified matter?
Let's me explain a bit for what I mean by "Uniform" - if someone would have
to Consolidate two different spreadsheet into one, and without matching the
Header Row, the data from Spreadsheet 2 just got copied to the end of
Spreadsheet 1, so data from SpSh 2 is not necessarily match the header row.
Is it possible to write a code to match them back up? I'm talking about data
from multiple spreadsheets being "jumble up" together here.

I don't think that Excel is powerful enough to do this, but please correct
me if I'm wrong.

Best Regards,
Neon520


"OssieMac" wrote:

I've copied your questions to this post because I think it is easier that way
to answer.

EX: Red highlight for Terminated record, Orange for On Hold, I can just run
the code twice to delete both records set, right?

Yes. run the code for each color.

3. Would it matter if ONLY the first column is colored and the rest of the
cells in such row are not.

No. It does not matter which column the color is in. However, the code looks
for the color ONLY IN THE SAME COLUMN where you select the color but it
deletes the entire row irrespective of what other colors are in that row.
Therefore if you select Yellow say in a cell column C and another row has
cell in column A that is yellow and the cell in column C is not yellow then
the row will not be deleted. It is possible to write code to test every cell
in every row and delete the row if the code finds a match. If you are going
to be running this code often then it is possibly worth the effort but if it
is a one off thing then not worth the effort.


A few clarifying questions:
1. Will your code still delete the Entire row if only the first column in
the row is colored, and that's the color I select when prompted?

Yes just so long as you select the color in a cell in the first column as
per my previous answer.

2. What does the code react if let's say most of the cells in the row are
RED, and a few are Different color, and when the code prompt, I select RED?
Will the code still delete such Entire regardless the few Different Code,
cause this is what I want.

Yes just so long as it finds the selected color in the column in which you
selected the color.

If you really need modifications to the code to test every cell in every row
then let me know.

i have replied to your other question asking for more info.


--
Regards,

OssieMac