Adding Search Function To Delete Matching Records..

Jun 1, 2009

I'd like to do is click the delete button and when clicked, it will search for matching records in column A & B and if they match... I'm thinking the code for that is <> but I'm not sure, then delete that record, and shift the cells up. Do this until the search results are empty below the delete button. Like I said, it's probably more understandable to look at the workbook.

View 5 Replies


ADVERTISEMENT

Search For Matching Text, Then Delete Rows Above It

Jul 8, 2009

Here is what Im trying to do: I have a VERY large excel file that has groups of 4 cells, a blank, then another 4, repeating. Kinda like the following:

ExampleCell1
ExampleCell2
ExampleCell3
UID = example

ExampleCell1
ExampleCell2
ExampleCell3

ExampleCell1
ExampleCell2
ExampleCell3
UID = example


That pattern continues for about 3000 lines. However, if you noticed, some of the "groups" dont have the 4th line "UID = example".

Here is what Im trying to do. I want excel to search for the cells with "UID" and DELETE it plus the 3 rows above. So that only the "groups" without the UID remain.

Now Im thinking this may be impossible, but I've seen some crazy things done with excel macros and was really hoping someone can help me out. Otherwise Im doing this manually for 3000+ lines of text.

View 7 Replies View Related

Function For Recognizing Matching Text And Adding Up Columns

Jan 8, 2007

I am currently tracking online PPC keyword reports with Excel and need to know if there is a function that will find and match words and phrases and then add the columns that are queried for the matching words/phrases. I think an example is definately in order.

December PPC
Keyword Clicks Cost Revenue
large dogs 45 .18 $12.00
small dogs 35 .25 $15.00

January PPC
Keyword Clicks Cost Revenue
large dogs 12 .14 $8.25
small dogs 18 .18 $5.35

Now using the example above I need a function or maybe even a macro that will scan all "keywords" and find a match for each keyword each month, say large dogs, and then add the clicks, costs, and revenue columns and post them on a particular row or rows.

So when running the function it will find and match "large dogs" for each month, it will then add the clicks for all months with "large dogs" in it and then populate a column or row with the total along with the keyword "large dogs" next to it. Is there a function that will do this or maybe even a macro?

View 10 Replies View Related

Userform Database: List Records In A Sheet As Well As Search For Records In A Sheet

May 7, 2006

example of a database user form that will allow me to list records in a sheet as well as search for records in a sheet. I know excel has a built in feature for this but it is menu driven and I need something that is button driven and will allow me to resize the form layout. I was not able to figure out how to do that with the built in form.

View 7 Replies View Related

Look Up For Matching Records

Jul 30, 2009

i have cell N1 witch is a number example "8832"
cell O1 is text example "state street"
now i have A1 thur A10 as an address "number"
now E1 thur E10 is street address "text"
i need to take n1 match it to A1-A10
then take that row number and see if E1 of that row numbers matches
O1 if it does that that row numer and get g of that number if not keep checking to i find a match

View 6 Replies View Related

Matching Records With VBA

Jul 11, 2006

I have 2 worksheets. Sheet 1 has in column B a single ID number in every cell, Sheet 2 in column A can have multiple numbers in a cell (e.g. "55517 / 55518 /55519" written in one cell.)

For every row in Sheet 1, I need to find the ID in Sheet 2 and add in column C in Sheet 2 the corresponding cell value found in column E on Sheet 1.

By doing this formula, when I am in Sheet 1, I can already find the row number in Sheet 2, if it exists.

=IF(ISERROR(MATCH("*"&B2&"*",Sheet2!A:A,0)),IF(ISERROR(MATCH(VALUE(B2),Sheet2!A:A,0)),"NONE",MATCH(VALUE(B2),Sheet2!A:A,0)),MATCH("*"&B2&"*",Sheet2!A:A,0))

I suppose I can then move to the destination cell by using OFFSET.

This is all I have been able to figure out conceptually.

I think it makes more sense for this to be in VBA. Especially the 'writing part' I don't know how to do. After the OFFSET part, how do you tell Excel to write something to that cell?

Because several IDs from Sheet 1 can occur in Sheet 2, it would have to add like REPLACE at the end (ie. len(cell)) "+result", so they get summed if there are multiple finds.

I am also not sure the MATCH sentence above can be translated as a Macro, or whether it is even an efficient way.

And finally, it has to loop (repeat for every row in Sheet 1), which must require VBA.

View 9 Replies View Related

Matching Records In Two Workbooks

Feb 3, 2010

In Excel 2003, I need a macro to do the following:

For each record in column F (starting at row 2) (workbook: CATS LITTERS LISTS AS AT 01 FEB 10.xls) (worksheet: RAKE)

Find a matching record in another open workbook (workbook: DOG TRAINING v 3.xls) that has multiple worksheets as

follows: ...

View 8 Replies View Related

Flag Non-matching Records

Nov 17, 2006

Our school system is trying to clean up student records. They have a demographic worksheet of hundreds of records. Each student has a student ID number. We are trying to flag students whose ID numbers in 9th grade do not match an ID number for 10th grade. so we are left with only students who have matching ID numbers for both 9th and 10th grade. We are trying to find the right function(s) to make this work without VBA. I am attaching a small sample file

View 7 Replies View Related

Find Non Matching Records In A List?

Apr 10, 2014

I have a list for example...

Ian
Andy
John
David
Ian
Andy
John
David
Max

I want to search or filter the list and find the only non matched record in the list and put this in another sheet ie max as this is the only unique name in the list, all the others are matched. Everything I have tried eg filter for unique records returns ian andy john david max, which is not what I want.

View 4 Replies View Related

How To Find Matching Records That Appear On Two Lists

Oct 14, 2011

I have two worksheets each of which includes a left column of unique email addresses (at least, unique within each lsheet)

The data on each sheet is structured identically. What I want is to generate a list of records that appear on both sheets.

View 2 Replies View Related

Finding Matching Records From Two Tables

Jul 14, 2014

I have two tables, both contain a column of ID numbers and a column of addresses.

I would like a method to match the IDs from table1 to those of table2 - if no matches are found, search for matching addresses, if a match is found then output the ID in table1, the address, and the corresponding ID in table2.

If still no matches are found, output the ID and address from table1 and indicate that it didn't match.

Then I want to check table2 records - i.e. search for matching address between the records and output the table 1 ID, address and table2 ID were partial or no matches are found, as above.

View 3 Replies View Related

Merging Two Sheets Overwriting Matching Records?

Apr 16, 2013

I have this sheet, which is just an example (the actual one has many more records).
subset.xlsx

I received this sheet (again, example)...
new.xlsx

I need to add the new sheet to the old sheet, so that they are merged into one sheet. Also, if the same "LOC" appears in both sheets, I need to overwrite all the records for that "LOC" in the old sheet with the records from the new sheet.

View 3 Replies View Related

Parse Multiple Files For Matching Records.

Jun 16, 2006

I need to use a macro to import data from an unknown # of order files to my master spreadsheet. My master spreadsheet & my order files contain a unique po number that can be used to find matching records. When the macro is ran & a match is found it needs to import the all data that to the master spreadsheet & updated the "processed" column for the record found. Also, all the lines in the unprocessed order files should be matched up. If a record is not matched, a warning needs to be displayed. If the record has already been processed, it just needs to be skipped. Attached is an example master spreadsheet & an example unprocessed orders spreadsheet. If at all possible, please split the unprocessed orders into separate files when testing the final product. The part that I will struggle with the most is looping thru separate files.

View 5 Replies View Related

Adding Values Against Duplicate Records

Jan 31, 2012

i have data as ( name , Father name ,CNIC, and there salaries , but there is repeating in this data so i want to add their salaries to one name and delete duplication , it should be done in excel. this data is so long .

View 2 Replies View Related

Unique Records Search

Nov 28, 2009

I have a formula for counting unique text records. However, is it possible to count unioque records based on certain conditions. For example, I have a stats sheet for a sports league and I want to count all the unique teams for dsivision 'North'. Coloumn A has the division, coloumn B has the team they played on that day.

I want to count all the unique records in column B, but based on those teams being in the 'North Division' (column A)

I want to do this with Excel, and not in VBA.

My formula for finding unique records is:

View 9 Replies View Related

Search & Display Records On Userform

Jul 3, 2006

I am very new to Excel/VBA. I have created a "Customer Complaint System" in excel and have designed a user form for users to enter new complaints.

My next step is to design a Search or Look up form for viewing the complaints where users can choose to look up complaints by either Complaint No or Customer or Month.

The worksheet that stored my data is called "ComplaintData" which is hidden. In the sheet "COmplaintData" I have following 10 Columns:

Column A - Complaint No
Column B - Date
Column C - Customer
Column D - Contact Person
Column E - Product
Column F - Batch
Column G - Category (This relates to Complaint Category)
Column H - Description
Column I - Account Manager
Column J - Month (This just takes value from B and converts to month, so hopefully I can sort by month if required..)

I did see a few examples of look up forms but am struggling to customise them to suit me.

Ideally I need a combobox & textbox in serach field. So user can choose the "Search by" category using combobox e.g. Complaint No, Customer or Month and then enter the relevent text in the textbox to carryout the search.

and then use labels & listbox to display the related fields on the form. The reason I prefer labels is that I do not want users to edit the info. and listbox to show multiple results out of which user can choose specific one....e.g. when user does a search by Customer, I want listbox to show the various products that customer has logged complaints for.

View 9 Replies View Related

Specify WorkSheet To Search & Display Records From

Jul 7, 2006

I have a product Database with 11 columns. I am trying to build a Search/look-up userform.

I found a brialliant example of the same posted by Roy, UK. I have copied the same and its working well, but with a few little problems.

Here's what I've got:

I have a userform with a Combobox (called Combobox2) where it shows all the products from column B in the worksheet "ProductData". In the worksheet "ProductData" , I have 11 Columns with headings from B1:L1.

When user selects a product from the dropdown list (from Combobox2), all the details related to that product from other columns are displayed on the userform via labels.

This part is working fine....except that the values in Combobox2 are taken from activesheet and I want them to come from worksheet "ProductData".
I have hidden the sheet "ProductData".

Second Part is, I have about 20 products in the Database and all of them have a Product Specification Sheet in PDF format. I am just wondering, if there is any way I can have a button on the userform that can used to open this PDF datasheet for the product thats being lookeed up by user.

What I mean is, if user selects productA from the combobox2, then it displays all the info about the the ProductA on the labels on the usewrform. and if user clicks on the "View Data Sheet" button then it opens the Datasheet PDF file for ProductA.

Below is my code for the first part:

Option Explicit

Private Sub ComboBox2_Change()
Dim ws As Worksheet
Set ws = Worksheets("ProductData")
Dim Ncell As Range
With Range("B2", Range("b65536").End(xlUp))
Set Ncell = .Find(ComboBox2.Value, LookIn:=xlValues)

View 9 Replies View Related

Search Records With Combination Of More Than 2 Values

May 24, 2007

i've written the code below but somehow the output is not what i want.

i have a multiple records and each records contain 30 rows of info i have 3000 over records and they are all in one sheet. i need to find record using more than 1 criteria. I've written the code below. how to use VBA to search for particular strings in cells?

for e.g.
A1 : hello
A2 : world
A3 : anyhow

i want to find the cell that contains "yh" using VBA, and the output should be in cells A3.....

View 9 Replies View Related

Searching And Displaying Data Records By Search Criteria?

Jul 23, 2012

i am trying to create an easy to use search by macro VBA in excel.

I have a sheet of information where i need to find the data records from either one of the 2 search criterias: Name and NRIC.

Once a user enter either of this 2 search criterias, i need a macro to search through the data on Sheet "List" and return the results on the Sheet "Search".

Within the list, a search criteria may appear more than once, the search results should display all of the records row by row on Sheet "Search".

Would it be better to create a user form?

View 3 Replies View Related

Matching Name Then Adding?

Jan 10, 2009

I'm trying to get column Z4:Z14 to add automatically from information from Cells A15:Y17 under the correct name of each person. I have created an example sheet.

View 2 Replies View Related

How To Filter And Delete Records

Jan 20, 2014

I am new to to VB Scripting, filter the records. In the attached file there are multiple records which needs to be filtered. Once all the records are filtered, i want to delete the entire row of that record(s). I want to filter column 'F' with the values mentioned in Sheet2. I tried recording a macro, but it is not allowing me to do so as the macro has some limitations. The search and delete row loop The main purpose is to delete the row of the value, if not found, move on to next value in Sheet2.

View 4 Replies View Related

Delete Records In Set After Classification?

May 23, 2014

I have a large (300K+ records) database with a sizeable amount of duplicate records. I want to delete the duplicates but this is not a matter of simply Remove Duplicates; I need to evaluate them before I do.

I am wondering what functions would:

1) select the specific record in a set of duplicates that makes a determination of a status
2) once the status has been determined for the set, delete all other records

Fields in my database:

ACCIDENT NUM (ID field, in text or General format)
DUP (for Duplicate, indicated by a character, for now its a "?")
OCC_KILLED (in Number format)
OCC_INJURED (in Number format)
SEVERITY (in text format)

Here are some scenarios:

ACC dup K I
12345 ? 0 0
12345 ? 1 2

Or:

ACC dup K I
123456 ? 0 1
123456 ? 1 0

Or:

ACC dup K I
1234567 ? 0 0
1234567 ? 0 2
1234567 ? 0 0

This is the formula for indicating if there are Duplicate records in the larger dataset:

=IF(OR(A2=A3,A2=A1),"?","")

I need to determine the Severity of the accident based on this:

If OCC_KILLED > 0 then SEVERITY = F (for Fatal)
IF OCC_INJURED > 0 and > OCC_KILLED then SEVERITY = I (for Injury)
IF OCC_KILLED and OCC_INJURED >= 0 then SEVERITY = F
IF OCC_KILLED and OCC_INJURED = 0 then SEVERITY = PDO (for Property Damage Only)

I have a code already in place for how to create the value for Severity but it DOES NOT account for duplicate records:

(in SEVERITY field):

=IF(A1<>0, "F",IF(B1<>0,"I","PDO")

sampleset.xls is a sample ot the database.

View 10 Replies View Related

Delete Duplicate Records

Jul 15, 2009

I have a spreadsheet with a column of records (text ) from B1:B4000. I would like to delete the entire row of the duplicate record. Overall data set range is (A1:I4000). This spreadsheet may contain more than 1 duplicate record. Is there in easy fix?

View 12 Replies View Related

Delete Of Duplicate Records

Nov 22, 2009

I'm having trouble getting this piece of macro to work. I want to delete duplicate Id records in (Cell B12 : B124), but only those with "No" in the (Cell Z12 : Z124) will be deleted.

Table
B12 Z12
-------------
E1 Yes
E2 Yes
E3 Yes
E4 Yes
E1 No
E2 No
E3 No
E4 No

Expected results:
E1 Yes
E2 Yes
E3 Yes
E4 Yes

View 13 Replies View Related

Delete Records From Spreadsheet

Jun 29, 2009

I have some data that looks like this.

No. Date
1519
1519 06/17/2003
1601
1652 06/30/2005
1652
1705
1705

What I would like to do is delete all numbers including those with duplicates that have a date of 2004 or sooner. In otherwords, anything from 12/31/2003 and later I want to keep, but anything from 01/01/2004 until the present.

View 9 Replies View Related

ADO Delete Database Records

Dec 21, 2006

I'm creating an Excel UserForm where the user can view, edit, and delete records they've entered.

The following code is for Deleting a selected record, and it IS WORKING. But it seems TOO SIMPLE and I want to be sure it's correct and not leaving any loose ends in the Database file that could cause corruption later on....

Sub vCLdbDel()
Dim cnt As ADODB.Connection

Dim dbPath, dbName As String
Dim stSQLAs String
Dim stCon As String
Dim dbid As Long

Run "setvars"

'Get the dbID from the selected Item in the list
With vCL.CLdbList
dbid = .List(.ListIndex, 6)
End With

'Path & FileName to the Database File
dbPath = M. Range("G2").Value
dbName = M.Range("G3").Value

View 7 Replies View Related

Delete Records When Cell In E Is 0 Or Blank?

Oct 31, 2008

I d like to find a method with which I can delete records from E starting from E2 that have 0 or even blanks with a macro.

View 9 Replies View Related

Auto Delete Records In Excel?

Mar 23, 2012

how to automatically complete with Excel the following task:

1. I have two email databases in Excel: a master database and opt-out database.

2. I need to remove from the Master database emails of opted-out people.

3. Since the databases are large, I'd like to use a relevant Excel function to do that automatically.:

In the master list (column B) I have all the emails from the Master list. I have copied in the column C of the Master list the emails of all who opted-out. I need to remove opted out emails (listed in column C) from the master email list (column B).

View 1 Replies View Related

VBA To Delete Records Based On Certain Date

Jul 18, 2012

I have a spreadsheet titled "PMIX" In Columns A:F Column F has Week Ending date. Each week, I need to update this, i.e. delete the data from two weeks ago and then add the new weeks data. What I am thinking is I enter a Week Ending Date in H1, then I would like VBA to delete all rows where it has the data in H1. I am hoping for a delete function as opposed to a clear so I can shift all the rows up.

View 3 Replies View Related

Delete Records When A Cell In E Is 0 Or Blank

Oct 31, 2008

I d like to find a method with which I can delete records from E starting from E2 that have 0 or even blanks with a macro.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved