Delete Rows Where Multiple Columns Meet Criteria

Apr 4, 2008

I am looking for an Excel VBA code that can delete pair of rows that has certain criteria. I have included an example in the attachment and highlighted the rows that should be deleted. Since the values in each coloumn is going to change every day , I am looking for a dynamic code.

The objective is to:

To delete rows that has same code (columnd D), same basis (coloumn E), same Effective (coloumn H), value of TT (Column J) is either TI or TO and has offsetting Amounts (L) ie the sume becomes zero. Example pair of row 7 and row 8 as well as pair of row 12 and row 13 should be deleted.

TO and TI are actually transfer in and transfer out. Since the TI and TO for these rows make the amount zero for same code and same basis on the same effective date, I do not want to include this in the spreadsheet.

View 3 Replies


ADVERTISEMENT

Delete Rows Where 2 Columns Meet Multiple Criteria

Aug 30, 2007

I have a file with many intercompany transactions. There is a range of business unit numbers that if anyone one number is in both Column B "Bus Unit" and Column E "Affiliate" I want the row deleted.

Please see the attached, it is more clear I hope. The two yellow rows would be deleted.
The list of business units that I would want to never be on the same row is "4, 7, 41, 44, 46, 51"

View 8 Replies View Related

Delete Rows When Meet Criteria Or Condition

Nov 21, 2006

I have a spreadsheet with 3023 rows and columns A-L. Here's a small sampling of Column A (with heading "sku" included, copied exactly as it appears in the spreadsheet):

A
sku
3102-0400-100000
3102-0400-200000
3102-0500-100000
3102-0500-200000
3102-0600-100000
3102-0600-200000
3102-0700-100000
3102-0700-200000

I need to delete every row in which column A includes the text "200000".

Although the above sampling shows "200000" appears in every other row, that is not the case in all 3023 rows.

View 9 Replies View Related

Sheet Of Data - Delete Rows That Do Not Meet Specific Criteria

Nov 29, 2011

I have a sheet of data. The data starts in row 4 and can be variable in length. I want to delete rows that do not meet a specific criteria, for example a location, Leeds, which is in column "i" of the table. I have written the below but it seems to delete data from row 1 rather than row 4 and repeat down each row

Code below

Sub deleterows()
Dim i As Integer
Dim intCounter As Integer
Dim strLocation() As String

p = Range(Cells(4, 6), Cells(4, 6).End(xlDown)).count

[Code] ..........

View 3 Replies View Related

Pull All Rows And Columns That Meet Criteria?

Dec 22, 2013

I would like to pull all rows and columns from a table and copy them to a separate sheet. I would like to pull the data if a certain value is present in a particular column. Essentially, it is the same effect of filtering the data but I don't want to have to keep filtering and copying specific cells and pasting them into a different sheet if I need to change the raw data.

Example: I would like to copy all ids, store, and partner information IF the partner is "X". I would like to put this information in Sheet A.

Capture.PNG

View 2 Replies View Related

Counting Number Of Rows Where Datediff Of Two Columns Meet Criteria

Aug 21, 2013

I have a range of data and need to summarize some of the data. In the table below is an example of the data. I would like to have a single formula where I can count the number of rows where the end date - start date is < 14 days. I would prefer not to add an additional column for the datediff value. Is there a way to do this with either arrays or named ranges?

Name
Start
End
Other data
Verizon
1/10/2010
1/25/2010
AT&T
3/2/2010
4/14/2010

View 1 Replies View Related

Search Workbook For Cells That Meet Multiple Criteria And Return Results From Rows

Jun 28, 2013

I would like to perform a search on only the worksheets listed in a worksheet titled table of contents. I would like to use multiple criteria for this search and send only the unique results to a worksheet titled results. Each worksheet listed in the table of contents has a cell address for each heading that I would like to extract data from the same column. The attached workbook example shows the data that I would like to collect when I search for cells that begin with "AB" and cells that begin with "CD". I collected this data by copy and pasting all the data from each worksheet into the results page and then applying filters and advanced filter to remove duplicates. This method does not work well for the original workbook as the data is quite extensive.

Create_List.xlsx

View 4 Replies View Related

Count Of Rows In Array That Meet Criteria In Column2 And Different Criteria In Column3

Dec 6, 2013

I have a table with 3 columns with an unkown number of rows (text, date, date) that is being imported daily.

I want to create a 4th column with dates starting from today and each subsequent row be one day earlier. I want to look at 30 previous days.

I then want to count the number of rows (looking at column 1-3) with the following criteria:

Countif column2<= "date in colum4" AND column3< "date in column4"

View 6 Replies View Related

Delete Visible Lines That Meet Criteria

Jul 29, 2009

I'm trying to apply an autofilter to do the ol' "delete visible lines that meet criteria" trick. Unfortunately my vb macro, although applying the string correctly, hides all of the lines...

This is the part of code relevant to filtering (i'm trying to filter on column M which is 13):

View 6 Replies View Related

Delete Multiple Columns By Column Name No Criteria Need, Just Delete Them

Jun 24, 2009

I would like a macro to find the columns named "apple" and "peach" and delete them. These would always be in row 1 but would always be in different column letters which is why I want the macro to simply find these columns by their name and not by their column letter.

And yes, I do mean the entire column altogether, shifting entire columns to the left. Wipe it off the face of the earth

View 4 Replies View Related

SumIf Two Columns Meet Criteria

Nov 22, 2009

On the attached example i would like a formula in F2 which sums all the values where column equals "Smith" and column B equals "Golf European". I'm assuming it would involve the SumIf formula but i'm not sure if this is the best solution when the criteria is in two columns?

View 3 Replies View Related

Count Row If 5 Columns Within Row Meet Certain Criteria?

May 30, 2014

Basically, need to count rows that have 5 columns of data in it. If all 5 columns within a row have something in them greater than one character, that row needs to be counted.

View 1 Replies View Related

Delete Rows By Criteria In 4 Columns

Jul 14, 2004

I have a large spreadsheet that is 65000 rows and colomns A thru W.
I need a macro to delete rows that if Date and Account and Type are
equal and the net of Quantity is zero delete those rows.

Col A = Date
Col C = Account
Col D = Type
Col J = Quantity

What the macro would do is if an account had 250 rows of activity on
say 7/7/2004 (Date) and same type of account and the net of all
Quantity is equal to zero delete those rows.

View 9 Replies View Related

Formula For Counting Row Once When Two Columns Meet Criteria?

May 17, 2014

BP Formula.xlsxI'm not sure what formula to use or if Excel can do this. I want to use it to determine number of blood pressures in a certain range. So if I use column A for SBP (systolic BP) and column B for DBP (diastolic BP). I want a formula to tell me if column A is between 140-159 or column B is between 90-99. I can get that part, but what I'm having trouble with is it counting each row twice if both column A and B meet the criteria, whereas I want every row (person) to only be counted once if either column A OR column B meet the criteria. (See attachment)

View 5 Replies View Related

Formula To Accept / Delete Cell If Numbers In Other Cells Meet Defined Criteria

Apr 21, 2014

I am looking for a formula that either accepts the number in a cell if the numbers on two other cells are "approved". In other words, I have on cell A1 my value to be tested. On cells A2 and A3 I have two numbers. On cell A4 I'm looking for a formula that copies the number on A1 if A2 is bigger then 0.25 and A3 is smaller then 0.35. In not, there's no copy or a N/A appears.

View 3 Replies View Related

Sum Rows In Column That Meet A Criteria

May 14, 2008

I have a filtered list of data expanded to "all" in each column. One column is "percentile" (25%, 50%, 75%, etc).

Search down the "percentile" column until you encounter 25% as an entry, then sum a number in the same row from a different column with each 25% entry you find.

View 4 Replies View Related

VBA Delete Row If Criteria From Multiple Columns Are Met

Aug 19, 2014

I'm trying to create a short script which performs the following:

Searches for a specific name in column C on my "Resource List" sheet, then When this is found, check column H to see if this is populated,Then when both criteria are met delete the entire row.

Using a link I found here [URL], I've put together the code below:

[Code] ....

The problem I have is that although the criteria are being met the row is not being deleted.

View 1 Replies View Related

Delete Multiple Columns If They Fit Different Criteria

Jun 17, 2009

Macro below would be to only go down to the cell = to the bottom-most cell with data in column A.

These columns below are all in row A (the title row)
If column named "paper" says "white" OR "grey" AND
column named "pizza" says "mushroom" AND
column named "size" says "large" AND
column named "flavor" says "butter pecan"..
(again, only going down to the same matching cell with any data in column a)

Then delete these columns.

View 14 Replies View Related

Delete Rows Where Multiple Column Meets Multiple Criteria

Sep 29, 2011

Need to create a macro?

Delete rows where multiple column meets multiple criteria.

detail:
delete rows where
Column H is less than 10000
AND
Column C is empty(blank)

Those 2 criteria have to occur at the same time..

View 1 Replies View Related

Move Rows To Another Worksheet That Meet 2 Criteria?

Jun 13, 2013

I attached a spread. On the data tab, I have 2 criteria that I would like to use to move rows to another sheet. Columns U and W. An example would be that all rows that have a coil in Bay "B" and are allocated would go on the "B Allocated" sheet. I would also like this to automatically update when I delete the data in the data sheet and put new data in.

View 4 Replies View Related

Delete Rows With Multiple Criteria

Sep 8, 2009

i have several student ID results that have conditional formatting in place. I'd like to KEEP the following data but delete/hide everything else:

1) Filter out purple rows
2) WITH filtered rows: KEEP any scoreA that's 100% or less than 85%
3) Look at Score A and Score B - KEEP if the difference is greater/less than 5%
4) If a student took testB but didnt take testA, KEEP.

View 2 Replies View Related

IF Formula - Skip Rows That Dont Meet Criteria

Nov 24, 2008

I have a spreadsheet which contains data for crime incidents occurring in a month. I have created a worksheet which uses "IF" statements to pull in data that occurred within the last 24 hours only. I would like to create a report that can be printed which has a crime category and lists all the incidents for that category below that occurred during the day. The issue I am having is that all "IF" and "LOOKUP" statements are line for line and I want to be able to skip blanks or where it is not the category in the title.

View 4 Replies View Related

Copy Rows From All Worksheets In Workbook That Meet 2 Criteria

Jun 28, 2014

I have a workbook with many (25) worksheets which all have the same structure, column headings, etc. but vary as to the number of rows. I would like to search all worksheets in workbook and copy to worksheet "120" only those rows where column C is "120" and column E is "1-00053-".

Ideally, input boxes would be used to enter these criteria so that it can be used for different scenarios in which these values will vary.

View 1 Replies View Related

Nesting OR & AND Functions To Meet Multiple Criteria

Jan 1, 1970

I want to put a formula in a spread sheet that if block f5 is equal to or higher than 20% of block b4 then block d3 * .0 if less than then * by .0078

View 14 Replies View Related

Scripting Dictionary - Compare Columns And Extract Data That Meet Criteria

Mar 23, 2014

I have a spreadsheet with 2 tabs:

AllData:
Name
Data
Read1

[Code]....

View 9 Replies View Related

Macro To Delete Rows Containing Multiple Criteria?

Feb 23, 2011

how they can be used to delete rows that meet multiple criteria, however all the examples I have found seem to be rather complex and personal to the individuals as opposed to being rather generic. Many people, including myself would find it useful to have a simplified generic answer that can be applied to all kinds of criteria. Such as if the data in column B = x and the data in column C = y delete the row. Here is my example.

SCENARIO EXAMPLE:

In column A - Date e.g. 05/02/2011, 06/02/2011
In column B - Day
In column C - Time (in format 09:06:21)
In column D – Service numbers dialled (70, 110, 224) two to three digits long

MACRO EXAMPLE:

Delete the row if the criteria in:
Column D = 10, 40, 192 or 244
And
Column C is between 09:00:00 and 16:00:00

macro code or at least a link to a thread that they think gives a scenario as simple as this.

View 5 Replies View Related

Delete Rows Multiple Criteria W/Numbers

Dec 23, 2009

I am trying to use the code below to eliminate data in a spreadsheet based on certain criteria. I have been able to get this to work with text fields just fine, but now I am running into an issue with numbers. I am trying to get this code to delete rows if they have the word "unknown" in column C and if the value in column B is greater than 900 hours (999:00:00), the numbers in this column are formatted as [hhh]:mm:ss. What should I tweak to make this work?

View 7 Replies View Related

Delete Rows Not Meeting Multiple Criteria

Feb 29, 2008

I have an extremely large CSV file that I am opening via Excel. Can anyone tell me how to delete a row using multiple criteria. For Example, i want to delete the whole row if a certain cell doesnt equal GA SC or NC. I have seen how it can be done using one criteria but not multiple ones.

View 8 Replies View Related

Formula For Counting Occurrences That Meet Multiple Criteria?

Mar 8, 2012

I have a row that contains a different time (hh:mm) in each column where each column represents a different date which is display in row 3. If there is no time the cell is populated with "N/A"

I want to count how many cells for a specified Month/year are not equal to "N/A". I have been able get each selction criteria to work but when I try merging numeric and non-numeric queries I lose it.

The following formula was able to give me the count of cells "N/A"
=COUNTIF('Master Data'!$UA59:$ALZ59, ">0")

and this gave me a count by Month/Year
=SUMPRODUCT(--(YEAR('Master Data'!$UA3:$ALZ3)=2012),--(MONTH('Master Data'!$UA3:$ALZ3)=1))

When I tried creating one COUNTIF I was unable to get it without an error as I needed the YEAR/MONTH functions.

View 7 Replies View Related

Macro To Delete Rows Based On Multiple Criteria?

Jul 10, 2014

A macro is required to identify rows within a selection e.g. entire column A, that share the same value, then delete appropriate rows depending on the values in another column. The attached example details the requirements.

Extract Rec1.xlsx

View 6 Replies View Related







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