View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Deleting Unneeded Records

Hi Bill,

Add a helper column (say column M ) to your data and insert the formula:

=OR(G2="Power",H2="Power")

in cell M2 and drag this down to the last row of data.

Then autofilter your data using TRUE as your criterion in column M.

This should return all the data you want to delete.

---
Regards,
Norman


"Bill Foley" wrote in message
...
Hey Gang,

I am trying something new and need some assistance. I get a new workbook
each month with several hundred records on one worksheet. I have written
the simple macros to do the following:

1. Create a new WorkSheet
2. Copy all data from Sheet1 to Sheet2
3. Delete the unneeded columns
4. Autofit the remaining columns

The last thing I need to do is to delete all rows where columns "G" or "H"
do not include the word "Power". I can't simply autofilter because I need
all records where "either" columns have "Power" in it.

Any code idea? I am sure it is simple, but my VBA use in Excel is much

less
than my knowledge in PowerPoint or Word (and that is somewhat limited)!

HA!

TIA!

--
Bill Foley, Microsoft MVP (PowerPoint)
Microsoft Office Specialist Master Instructor - XP
www.pttinc.com
Check out PPT FAQs at: http://www.rdpslides.com/pptfaq/
Check out Word FAQs at: http://word.mvps.org/FAQs/General/index.htm