delete rows

  1. N

    Delete rows with cells that have same value

    I have a sheet with rows that extend to about Column AT. In some of the rows, all the cells are populated with "--". I want to delete these rows. Other rows have "--"s but not in every cell. I tried to remove all the "--"s then running this code: For t = 2 To...
  2. L

    Delete rows if specific columns contain cells with "N/A"

    Hi, I would like to set up a button where cells with "N/A" in specific columns will then delete the relevant row - the columns are Z, AA and AB. When I use the code below it does not seem to work. The code is the following: Sub Button3_Click() 'Declare variables Dim rngFound As Range...
  3. R

    Activate not Select, Apply special filter and delete visible cells

    Folks, How do I change this code so that it does not have to select the cells, but can activate them instead? 'Delete Filtered Rows Application.CutCopyMode = False Range("a2", Selection.SpecialCells(xlCellTypeLastCell)).Select Selection.SpecialCells(xlCellTypeVisible).Select...
  4. S

    Automation Error When Trying to Delete Row

    Hi, I have been searching for a way to delete a row based on the value of a particular column. I keep finding "functional code" online, but they all result in automation errors for me. Basically, what I want to accomplish is this: When the "delete activity" button is clicked, excel will...
  5. D

    Extend VBA code to multiple sheets

    Morning all, I have created a code that allows me to remove rows based on a certain criteria. My limited VBA skills are now evident, as i need to extend this code across the entire workbook but have come a cropper! The code is as follows: Sub Delete_Rows() Dim rng As Range, cell As Range...
  6. J

    Delete one of the duplicate rows from two different worksheets?

    I have seen plenty of codes online but none of them seem to work with what I'm doing. I have 2 worksheets. I want the code to run so that when worksheet 2 from column B to D is equal to any value in worksheet 1 from column B to D then delete the entire row in worksheet 2 ONLY not both...
  7. M

    Delete Row Based on cell Value with wildcard

    Hey there! I'm struggling with some code I found on another site (here:How to remove rows based on cell value in Excel?) The code works when I specify a specific value but I'd like to use cell.value like "*something*" For some reason this code doesn't seem to work... Sub Delete_Rows() Dim...
  8. A

    How do I sum a column of values when rows are inserted or deleted outside the formula?

    If I have a spreadsheet that sums a column of the rows above it, I obviously have to refer to the starting row/cell, say A3. I then refer to the ending row/cell, say A10. My problem is that my users will insert new rows above row 3, but my formula says start at A3. If there is a value to be...
  9. X

    How to delete rows in multiple sheets if cell value equals cell value in another sheet? VBA

    I saw this post and I'm trying to determine how to replicate it for mutliple sheets. I have a sheet called "Discharge" which has clients who left the program in the past quarter. I want to remove anyone with an ID in the Discharge sheet in sheets Services (1) - (4). ID #'s are in column A for...
  10. H

    Find and Delete Rows with Empty Cells in Column A (VBA)

    Hello all,I'm trying to write a VBA code that will allow me to reference column A, then find the all cells that have no data inputted. After this I want to delete said row(s). The issue that I am running into is because the data that I am using has been copied from another sheet referred to as...
  11. S

    Deleting Rows Where Cells in Multiple Columns are Blank

    I work with a spreadsheet every week to input values and subtotal them. These values change constantly and instead of going through and manually deleting each row in a 100+ row spreadsheet to be able to import into another program, I'm looking for an quicker way to keep my data in order but...
  12. C

    How to delete rows that start with a letter rather than a number

    Hi I have a sheet that has letters and numbers in the "A" column but I want to keep only those that start with a number and delete all those that start with a letter here is the code that I adapted from another post : count = 0 For i = 7 To 151 Select Case Val(Left(Range("A" &...
  13. M

    VBA: delete all rows code

    Hello, I am trying to do a macro that would loop through desired sheets (ie. sheet 1, 2, 3... but not sheet 4) and run this code: Sub clearcells() '//Declare variables// Dim varDelItem As Variant Dim lngRowStart As Long, _ lngRowLast As Long, _ lngRowActive As Long...
  14. S

    One column with data, delete rows NOT containing data

    Hello all, I have a list of data in Column A in Sheet 1, and in Sheet 2 I have 1000s of rows where that data may appear once, multiple times, or not at all. I would like to delete all rows NOT containing the data in Column A from Sheet 2. How can I do this? Let me know if you need more...
  15. J

    Use VBA to check if cell value is in a named range and delete row if not

    Ok, so I can't figure out how to do this at all. I basically have a spreadsheet with varrying number of rows. I want to check the value of a specific column (K) and if the value of that column is not in my named range I want it to delete the entire row. Currently I am using a lot of macros like...
  16. J

    Macro to Delete blank rows in a Table

    Hi all, I recently found this macro on these forums for deleting rows where all of the cells are empty. Sub RemoveEmptyRows() On Error Resume Next With Range("B300:B1000") .Value = .Value .SpecialCells(xlCellTypeBlanks).EntireRow.Delete End With End Sub Unfortunately my...
  17. T

    Difficulty deleting rows + columns

    So I have a user who has managed to max both rows and columns with empty cells in excel 2007. Even with everything else closed, I can only delete a few rows or a few columns at a time before I am forced to save. Generally if its maxed on either rows or columns, I can CTRL END and delete + save...
  18. W

    protected worksheet

    I need to insert and delete rows in a protected worksheet. When I set the protection, I indicate the user can access unlocked cells, insert and delete rows. After I save the worksheet and try to add rows, it will let me but it will not let me delete rows althought the access box to that task...
  19. H

    Scroll bar problems / Absurd amount of rows showing up out of nowhere. Please Help!

    Hey there Mr. Excel board, This spreadsheet that I have been working on is up to about 1100 rows. Today, suddenly a ludicrous amount of rows appeared at the bottom of my spreadsheet- (All the way up to Row # 1,048,576!) As a result of this, my scroll bar on the right-hand side of my excel...
  20. S

    Delete all rows under row number 2

    How is it possible to delete everything except Range("A1:D2")? I once saw something using Rows() in which it was specified to delete all rows from row 3. Is there any difference whether it's deleted or cleared? How can I be sure that it wont use memory?

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top