Delete Rows Based On Cell Contents

Aug 29, 2007

I have merged two workbooks into one. What I need to do at this point is to delete all rows that have a duplicate entry, basically anytime the cell content in one cell matches the cell content in the cell right below or above it, BOTH rows should be deleted. At this point, this is above my VBA skills so I'm asking for help in how to do this. The stripped version of the workbook is attached (only 100 rows) but in reality this is a huge workbook with almost 22,000 rows.

You will notice in the attached workbook, that cell contents for A2 and A3 match. For what I need to do, I need both rows (2 and 3) to be deleted. If you go down a bit, starting in row 89 all the contents in column A are unique so those need to remain.

View 3 Replies


ADVERTISEMENT

Move Cell Contents & Delete Rows

May 23, 2006

I have a spreadsheet with a serial number is row 1 in column A with the rest of Row 1 empty. Column A is empty in Row 2, but has the data associated with the row above in columns B through L of Row 2. Then comes 2 blank rows and the pattern repeats with a new serial number in column A of row 5 and so on. I would like to move the serial number down one row, delete the now empty first row, delete the following 2 empty rows, and then loop to do the same thing again for all 9000 rows of the spreadsheet.

View 2 Replies View Related

Delete Cell Contents Based On Color

Feb 14, 2008

I am using conditional formatting to apply a light green color (index number 35).
Is there a macro that can delete the cell contents of the cells with this formatting in col K and L?

View 9 Replies View Related

Delete Contents Of A Cell Based On Char Count

Jul 23, 2008

I have this forumala.

=RIGHT(A1,MIN(500,LEN(A1)))

I would like to apply this formula to VBA and call to existing macro so that this is applied to all the cells in Col. A. How can I do that? Or, is there a better way to do it?

Buttom line, I'd like to see only the last 500 characters per cells in Col. A after I run the macro.

View 9 Replies View Related

Duplicate Rows Based On Cell Contents?

Mar 12, 2013

Every week I get a report that contains 1 or more (sub) part numbers in each row down column E, separated by a space. I need each part on a separate line, with the rest of the data on that row intact. Because these are the sub-components of an overall part, the data in column E is stored grouped together like that.

I currently use text to columns to break those up, separating them by the space, add a count of those cells so I know how many sub part numbers there are, run a 'duplicate rows' macro on that count, then manually delete out numbers so I'm left with one part number per row. The report is already over 100 rows long, so after I run the 'duplicate rows' macro I have a lot of rows to work through.

View 7 Replies View Related

Tagging Rows Of Data Based On Cell Contents

Apr 15, 2014

I'm am trying to set up a household finances dashboard in excel - What i'd like to do is categorise & tag HH expenditure based on part of the description within a bank statement, the desired result being:

account tagging.jpg

My ideal solution would be some kind of lookup with a table containing the keywords & corresponding tags to match part of the description to, as this will allow easy management of the tags, situations where I have multiple keywords for the same tage (supermakets for example), and so forth. Is this possible?

Currently I am using a very large nested forumula which i've cobbled together based on searching for ideas. It works, but managing new tags is difficult, part of the formula i'm using is:

=IF(ISNUMBER(FIND("00111888",'JOBSFPCUR-20140414'!C4)),"Pete transfer",(IF(ISNUMBER(FIND("LAURA",'JOBSFPCUR-20140414'!C4)),"Laura Pocket Money",(IF(ISNUMBER(FIND("TESCO",'JOBSFPCUR-20140414'!C4)),"Supermarket")))))

View 2 Replies View Related

Selecting Entire Rows Based On Contents Of Cell?

Jul 15, 2013

I have a large set of data regarding the activities going on in particular rooms. The data contains activity name, start time, day, duration, room and size.

I would like to select all rows that contain a cell in the activity name column which contain the words 'VideoConference'.

I have tried to Search, Select All then index the remaining data using =iferror(index(etc. However some activities occur in more than one room and all variables apart from 'Room' are the same. Thus when I have tried to index the room column I get the same room for both rows.

ps the raw data set consists of +28000 rows so I can not simply look through and copy.

View 4 Replies View Related

Macro - Format Rows Based On Cell Contents

Aug 18, 2009

I have a spreadsheet that has a subtotal row after each data grouping. I need help with a macro that will go to column C, look for any cells with the word "Subtotals" in it, and format that row based on another macro I already have set up. I've tried about 50 different types of macros that I found out on the web, but none have worked.

View 9 Replies View Related

Delete Rows Missing Contents In AF Then A

Jul 23, 2009

If a row in Column AF does not say “Cust” than I want to delete it, next if a row in Column A does not say “Numb” I want to delete it.

View 3 Replies View Related

Delete Contents From Multiple Rows

Dec 29, 2012

I'm trying to put together functionality which allows the user to remove cell content within a selected row. I've chosen to remove the cell content rather than to delete the whole row because I need to maintain the 'Input Range'.

The code below is the script which I've put together to clear the cell contents.

Code:
Sub DelRow()
Dim msg
Sheets("Input").Protect "password", UserInterFaceOnly:=True
Application.EnableCancelKey = xlDisabled
Application.EnableEvents = False
msg = MsgBox("Are you sure you want to delete this row?", vbYesNo)

[Code] ........

The code works fine if the user selects one row. However, if the user selects mutliple rows, although the text values are removed from all rows, only the 'Interior Color' is removed from the first rather than all and I'm not sure why.

View 3 Replies View Related

How To Clear Contents / Delete Rows On Click Of Button

Nov 3, 2013

I have a spreadsheet containing 100 "requests" which can be made by a user

i would like the option for the user to be able to delete a request should they wish it either by deleting a row or clearing the contents

Currently I have a single column which is full of buttons (one for each row)

when i click the button on row 10 I would like row 10 deleted

when i click the button on row 30 i would like row 30 to be deleted etc

is there a way to do this without writing 100 macros which are specific to each line?

View 4 Replies View Related

Delete Rows Based On Cell Value?

Jul 6, 2014

I am looking to make a cell with the Value =Today()-1. I then want the code to pick up the cell value and then delete any row that does not have that value.

So for Example it would only keep =Today()-1 Dates in the sheet and delete the rest.

Code:

Dim LR As Long, i As LongWith Sheets("Sheet1")
LR = .Range("Q" & Rows.Count).End(xlUp).Row
For i = LR To 2 Step -1
If .Range("Q" & i).Value = "Y" Then .Rows(i).Delete
Next i
End With

View 9 Replies View Related

Excel 2010 :: How To Delete Rows Based On Cell Value

Sep 23, 2011

I have a massive spreadsheet (ca.110 000 rows [excel 2010). I need to cut this monster by deleting all the cells that do not have a certain cell value within them.

Say that in my column A there are different entries (text type). I would like to delete the ones that do not match the following criteria:

"mytextascriteria*", where * somehow stands for the rest of the string.

Strictly speaking I can only determine beggining of the string I want to perserve but the values at the end of that string are changing.

I found the thread about deleting entire row based on a cell value here:
Delete entire row based on one cell?

but I couldn't quite work out how to apply it in my scenario....

Otherwise is completely pointless to do it manualy with these amout of records.

View 5 Replies View Related

VBA Delete Entire Rows Based On The Value Of Single Cell

Jun 10, 2009

I know it can delete entire rows based on the value of single cell, I just don't know how to do it. So what I need is a macro that will delete an entire row if the value in a particular column = 0.

More details: ....

View 9 Replies View Related

Modify Macro In Excel / Transpose - Delete Contents - Skip X Rows - Repeat?

Mar 7, 2013

I have a list in Excel, and it has the company in one column, and it's information in the next x rows until there is a blank row (4-7 rows). I get that you can copy the rows under the Company, transpose next to the company, and then delete the contents of the cells that you just took the data from, but I have 6200 rows do to this to, for 500+ companies. I tried recording a macro for two entries, and this is what I have (see below), but how do I modify this so that I don't need to type in every single range, and it will do it to the whole column? The data is in column A, I am posting in column B.

Basics for Macro Requirement:

1. Find the blank cell in row A
2. Skip the next cell/row (this is the company)
3. Select all the cells beneath the company cell, until it reaches the blank cell underneath
4. Copy, transpose these cells next to the Company cell (transpose in column B)
5. Delete the contents in row A that were just transposed
6. Find the next cell with data (company)
7. Repeat Steps 2-6

My recorded Macro:

Sub Macro2()
'
' Macro2 Macro
'
' Keyboard Shortcut: Ctrl+q
'
Range("A3:A8").Select

[code]....

View 5 Replies View Related

How To Delete Rows Based On Whether Or Not A Cell In Column B Is Empty Or Null

Jun 23, 2014

I am building a template ("Table") that will import data from 4 other spreadsheets and then format the data once its all in the template. I need to delete all rows where a name didn't import. The names are landing in column B (starting with B22), so I set up my code using an active cell loop macro to examine each cell to see if it was empty, and then to delete the row if it were. I've tried 4-5 iterations of code but nothing is working correctly.

Apparently when the fields are copied over from the other spreadsheets, some empty cells actually have something in them such that they are not completely blank. What syntax I can use so that I capture every instance of a blank/empty cell and delete that corresponding row? Some of the code I've tried is below.

[Code] .....

View 3 Replies View Related

Delete Columns And Rows Based On Cell Fill Color

Jan 31, 2014

I am a locksmith and attempting to write a spreadsheet app. for my line of work. The output page will use columns A-G and rows 1-?10000? depending on the size of the system. If a 5 pin system is requested then columns A+B will be blacked out. 6 pin system A is blacked out. 7 pin system nothing blacked out. Also, if any cell matches the master key that was input, that cell is filled with red. I know, confusing.

Basically, I am trying to remove the blacked out columns automatically, and to remove the enitire row is any cell in that row is filled with red. Then to remove blank lines.

View 2 Replies View Related

Delete Duplicate Rows Based On Cell/column Values?

Oct 28, 2009

I have a excel file which contains dublicate rows. The duplicate rows can be identified based on few cell/column values. I need a macro to delete the duplicate rows when the below condition is satisfied: let us consider row 5 and row 6:

If column 7,12,13,16,17,18,19,23,24,27,28,29,30 in row 5 = row 6 then row 6 has to be deleted. This condition has to be followed for all other rows in the excel used range. Have attached the sample workbook.

View 5 Replies View Related

Delete Duplicate Rows Based On Multiple Cell Criteria

Apr 21, 2007

I have some VB code, courtesy of OzGrid and Davc4, that works well to delete duplicate rows based on criteria in Column A of the active worksheet (albeit a bit slow on large files).

How do I modify the code below to evaluate duplicate data in Columns A through D? .....

View 7 Replies View Related

DELETE CONTENTS If There Is Nothing In The Cell

Mar 14, 2008

What I need to do is starting at cell E251 of the Cheque Logging Sheet I need the code to check the cell for any contents and if there is nothing in the cell then DELETE THE CONTENTS then move to cell E250 and do the same all the way up to E2

My ACCESS problem is that even if the cells in Column E contain nothing the only way that I can upload the spreadsheet to Access is by deleting the contents of the empty cells. Currently I am doing this manually but I would rather sit back and have VBA do it for me...

View 9 Replies View Related

Return Contents Of 1 Cell Based On Contents Of Another Cell?

Mar 12, 2014

I thought this was a pretty simple formula but I am having difficulty creating it. I am attaching a little test spreadsheet. Sheet 1 is where the data will be entered. The Reimbursed column has a drop down choice of yes or no. The next 2 columns are the cost of registration and the cost of accommodations. On sheet 2 is where I would like the formulas. So in cell A4 I would like a formula that says if B3 on sheet 1 is Yes populate this cell with the contents of Cell C3 only, B4 of sheet 2 would then be B3 if A3 on sheet 3 is Yes and so on with the Not reinbursed if sheet 1 the Reimbursed column is no.

View 3 Replies View Related

Formula To Delete Cell Contents After Use

Feb 28, 2007

I need a formula that would scan a given column for data, get the first available data from the first available cell ( D1 ), perform computation, input result in a different cell ( A1 ) and then delete the contents of D1 and move on the D2 and so on till end of data. So far I have been able to have the result in A1 but could not achieve the deletion of D1 contents. The purpose is to prevent the formula from scanning the data column from D1 again. In this way, the datawould be made available in one column and when the data have been processed the column would be empty and the result would be in another column.

View 2 Replies View Related

Hide A Rows/columns Based On A Cells Contents

Jun 30, 2006

way to automatically hide a row or column based on a specified cell.

Or even something general like: Hide all rows with cells evaluating to #n/a.

View 9 Replies View Related

Delete Contents Of Cell If Text Is Present?

Feb 13, 2014

Need to search a sheet and find cells that contain the text "Requirement". If found then i want that cell to become blank.

example
so in sheet1,

i have a number of columns and a number of rows

in cell A3 the value is - " there are requirements"
in cell F23, the value is -"the Requirement is"

since both cells have the word requirement, I want these cells to become blank.

View 1 Replies View Related

Delete Contents Of Cell If Text Is NOT Present

Feb 19, 2014

Need to search a sheet and find cells that contain the text "."

Want all cells that don't contain a "." (dot) to be erased from the sheet

Example : so in sheet1,

I have a number of columns and a number of rows

in cell A3 the value is - " there are requirements."
in cell F23, the value is -"the Requirement is."

since both cells have "." ( dot) , I want these cells to remain in the sheet, but the rest of the cells should become blank.

View 3 Replies View Related

Delete Entire Row Depending On The Contents Of A Cell

Jan 20, 2009

I'm trying to write a procedure which will search the contents of Column B of my worksheet for the word "Total". Whenever the word "Total" is found in a cell within Column B, the entire row should be deleted.

View 5 Replies View Related

Excel 2010 :: Delete Cell Contents If Cell Contains Numerical Value?

Oct 8, 2013

Recently I have been practising writing my own macros in VBA. I am using Excel 2010.

I have been trying to write a macro to look at two columns in a worksheet (say, columns D and E) and to delete the contents (not the formatting, and I don't want to delete the cell itself) of that cell only if it contains a numerical value (e.g. 1, 2, 256 or any other number). If it finds a cell with letters, then it wouldn't delete the contents of the cell. The cells are currently formatted as "currency" cells.

I have been trying all sorts of things and I just can't get it to work. I can write a macro to clear a range easy enough, but I am stuck on getting it to delete the right stuff. I won't embarrass myself by uploading the code that I have been using..

View 7 Replies View Related

Delete The Contents Of Every Cell Without Deleting Any Code From My Module

Apr 16, 2009

I want to delete the contents of every cell without deleting any code from my module. The reason I ask is, I'm reading from a text file into excel.

I want to run my code to read text into excel one time through. Then i want to delete all the text, make some alterations to my code, and run the code again. That way each time the worksheet is fresh and clear before i run the code.

View 4 Replies View Related

Delete Rows Based On Criteria & X Rows Below

Mar 5, 2008

This sheet has A:K columns and 1:3212 rows. There are 'page headers' that are in the text file that I want to delete (the text file was exported from an AS400 program). The first row that starts the page header has SA341 in column 1. Each page header has 5 rows. I used this code from one of the other threads on deleting rows, but I obviously do not understand the code as it deleted all rows that contained SA341.
Sub DeleteRows()
Column_To_Check = 1
Start_Row = 1
End_Row = ActiveSheet. Cells(Rows.Count, Column_To_Check).End(xlUp).Row
MsgBox End_Row
Search_String = "SA341"
For Row_Counter = End_Row To Start_Row Step -1
If ActiveSheet.Cells(Row_Counter, Column_To_Check).Value < SA341 > Search_String Then
ActiveSheet.Rows(Row_Counter).Delete

End If
Next Row_Counter
End Sub

View 9 Replies View Related

Delete Rows Based On Values In Rows Below

Jun 20, 2008

I am copying a price list from a worksheet. I currently have a script that deletes unwanted rows (products) but these products' header rows' are left. I also want to delete these text based headers. One solution might be a script that reads a columns cell value in the row(s) below and if values are missing the header row should be deleted.

View 2 Replies View Related







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