Re: Possible VB code to lookup and remove unwanted data

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



One simple procedure using autofilter on a helper col
to effectively deal with this ..

Assume the unique customer IDs are in a sheet: x
running in A2 down

In sheet: Data, assume the cust IDs are running in A2 down
Insert a new col A
Put in A2:
=ISNUMBER(MATCH(B2,x!A:A,0))
Copy A2 down to the last row of data in col B
Col A will flag all matching ids as TRUE, FALSE otherwise

The rows with FALSE are the ones to be deleted
To do this, just apply autofilter on col A, filter out: FALSE
Then select all the filtered rows, Right-click > Delete Row
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Sarah (OGI)" wrote:
I've got around 53k rows of data in an excel worksheet, labelled Data. Each
row has a customer ID. I've put all the data into a pivot table on another
worksheet, which is how I want to display the results. However, I don't need
data for all customer ID's. In a separate worksheet, I've got a list of
unique customer ID's that I need information on.
Is there any way (perhaps VB code/macro?) that I can look in the datafile of
53k rows, find a customer ID, compare that with the unique list of ID's and
if it's in there then ignore it (not do anything with it), and if it isn't in
there, remove it from the datafile?
.



Relevant Pages

  • Re: Excel Spreadsheet question
    ... I will assume the IDs are column A in both sheets and that row 1 is either ... In A2 of the large sheet enter ... Select all of the data INCLUDING the top row and use Date | Filter | Auto ... need to delete from the larger 20,000 customer list. ...
    (microsoft.public.excel.misc)
  • Re: Macro Error 3
    ... Dim cell As Range, swop As String ... > it moves the costs from the sheet carriage to the sheet customers which ... > carriage which did not appear on the sheet customer. ...
    (microsoft.public.excel.programming)
  • Macro Error 3
    ... it moves the costs from the sheet carriage to the sheet customers which ... The second part of the macro was to highlight customers on the sheet ... carriage which did not appear on the sheet customer. ...
    (microsoft.public.excel.programming)
  • RE: Excel Spreadsheet
    ... customer information in rows across the sheet. ... Dim formSheet As Worksheet ... 'to form sheet cell B2 ...
    (microsoft.public.excel.worksheet.functions)
  • RE: Just a little tease on how to place proper product spin.
    ... IDS may be ... horrendous of product positioning.> ... Product overlap also gives a customer choice. ... on with IBM. ...
    (comp.databases.informix)