delete row

  1. airforceone

    Deleting Entire Rows in Range

    needed help again.... what I'm trying to do is, loop thru the range (until last row) and delete entire rows if cell is empty/blank or cell value not equal to "PAID" below code does not seem to work LROW = 2 Do While LROW <= LastRow If (IsEmpty(Cells(LROW, 4)) = True Or Not...
  2. D

    Macro to delete rows based on cell values in a range - dynamic rows and columns

    Hello team, I would like to ask for help with the following macro as I just can't figure it out, I tried so many versions but nothing worked for me. I need to remove all rows in my sheet that do not contain value greater than 50 in any cell in a given row. That means that if the value is less...
  3. R

    VBA: Trying to delete all but the first row of a table

    I want to delete all rows in a table EXCEPT for the first row in the databodyrange. Using tbl.DataBodyRange.Rows.Count, I plan to delete that many -1. The problem I'm having is figuring out how to select my starting row in the databodyrange down to the last row of the table. I thought of using...
  4. K

    VBA Delete Rows of Previous Year

    Hello, I have the following code to delete rows with old data. Below are all the lines pertaining to the functionality I'm asking about, but please note that this is a very small piece of a much larger macro. The data is considered "old" if it matches the month entered via a user input box...
  5. K

    vba delete rows with cells not in a list

    Hello, I've seen some variations of this on the forum, but not really what I'm looking for. I have a list of users that's created through a Pivot Table, which I named "UserPivot." I also have a set of data on a worksheet. I want to check through that list of data and, if the username in...
  6. F

    Deleting rows based on a variable in 1 column

    hello, I have created some code that will delete an entire row based on if the value 1 is in the column or not. The code works but takes 40 minutes to run on 300,000 lines. Is there a better method to make this work? Sub Delete_Rows() Dim i As Long Dim LastRow As Long...
  7. E

    Delete Rows Where Column A Does Not Equal a Number or Numeric Value

    I thought I would be able to find a macro for this but could not. Pretty straight forward. "Delete Rows Where Column A Does Not Equal a Number or Numeric Value" Anyone have a solution? Thanks!
  8. VBE313

    Easier way to write this?

    I created an excel template that forces the user to enter data in every other column. What this code is meant to do is "delete" the active row of data and move up the data below it. I have it searching every 40 rows down to see if there is a value in there, if there is not a value then it knows...
  9. G

    VBA delete rows

    I have an Oracle report that is converted to delimited text. I need to delete the entire row if column A is blank. I need the VBA to start on row 30. Does anyone have a VBA code for this? Thank you.
  10. M

    VBA - Delete a range of TEXT rows and move Numbers to preceding row

    Hi all, I am a newbie and I would appreciate if someone could help to correct my code that is intended to delete all rows of a worksheet, excluding the rows starting by"2018" and the rows with some numbers separated by comas. the datasheet is setup as csv within column A and starting in A1...
  11. M

    VBA - Delete a range of rows if column contains a specific range of data

    Hi all, I am looking for a code that can delete a range of rows when the find condition is met,that is the string " Configurable" is found and then all the rows including configurable and exluding the number "2018". the dataset is setup as csv within the first column file. the first range of...
  12. G

    Deleting row when condition is met

    HI, I have a row of data and want to delete a row if the condition is true. What is wrong with my code? Sub deltotal() Lastr = Cells(rows.Count, "A").End(xlUp).row ctes = Range(x, 1) For x = 1 To Lastr Step 1 If Application.WorksheetFunction.Left(ctes, 18) = "Total for Customer" Then...
  13. P

    Compare 2 columns delete the row if match found

    <tbody> A B C D E 1 1111 1 4444 2222 0 2 2222 0 3333 0 3 3333 0 1111 5555 1 4 4444 1 6666 7777 0 5 5555 1 8888 1 6 6666 1 1010 0 7 7777 0 9999 8 8888 1 9 9999 0 10 1010 0 </tbody> I am trying to compare Column A and Column C and if the number in Column C is...
  14. J

    VBA multiple selection

    Is there a way to allow multiple selection delete? Like the user selects more than 1 cell and pushes the delete button without causing an error to a macro? I know to allow multiple selection is something like Target.Count > 1 . How can we incorporate if the user deletes multiple cells? Also...
  15. M

    Trouble deleting entire row

    I'm having trouble with the below not deleting the entire row. For Each cel In Range("L1", Range("L" & Rows.Count).End(xlUp)) If Left(cel.Value, 1) <> 8 Then cel.EntireRow.Delete End If Next
  16. X

    check if cell in named range

    Hello, I have two sheets sheetA and sheetB with two names ranges rngA and rngB respectively. rngA in sheetA has one column and contains cell addresses (like, $F$6, $H$2, $G$3, ...) rngB in sheetB is say $F$3:$H$9 I need to delete cell addresses in rngA that are not in rngB. For example, $H$2...
  17. L

    Dynamic named range #REF! error after row delete

    I am having issue with a dynamic named range that is changing its reference if I delete a row from it using VBA. The Named range is: AllJobsData =OFFSET(Data!$A$7,0,0,COUNTA(Data!$C$7:$C$1048576),7) The VBA code below is designed to go through each line of AllJobsData, bottom up, and delete...
  18. M

    Delete all rows not containing specific information in column A

    Hi! I have this code deleting all rows that do not contain the text "A#ABN" in column A. However, I also need to keep rows containing the value "A#UUW" also. Single delete works perfectly, but I struggle when adding more criteria. I´ve tried different versions of code two, but still noting:(...
  19. K

    Command button delete rows... sort of

    Hi, I found a peace of code written bij Joe Was in: I modified it to work on a command button. But it removes every other row :confused: Lets say row 11 till 18 are empty/< 1 then it removes 11, 13, 15, 17. I've...
  20. M

    Delete entire row based on multiple conditions

    Hi all I want to code the following: the macro has to delete the entire row if the value of the cell in column AR is "ABC", "DEF", "GHI" or "JKL". My code deletes only the rows containing ABC and GHI.. Could anybody see what's wrong in the code? Dim i As Range Dim wsTest As Worksheet Dim...
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

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
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 "".
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