delete row

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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!
  6. 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...
  7. 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.
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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...
  13. 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
  14. 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...
  15. 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...
  16. 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:(...
  17. K

    Command button delete rows... sort of

    Hi, I found a peace of code written bij Joe Was in: https://www.mrexcel.com/forum/excel-questions/9165-entire-row-delete.html 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...
  18. 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...
  19. P

    VBA Delete row if value in column A does not equal value in cell B2

    Good Morning, I have been searching for hours for the answer to this question. I have ZERO experience with VBA, but am trying to make an idea come to life. I have an excel sheet which pulls a bunch of data from an Access Query. I want the user of this spreadsheet, specifically tab/worksheet...
  20. V

    I need the checkbox to be deleted when the row is deleted...

    Hello, I have a spreadsheet where there are checkboxes for each row. I have a macro that deletes unwanted rows, but the checkboxes remain. How do I get them to be deleted when the row is deleted? Please save me! :) Mandy

Some videos you may like

This Week's Hot Topics

Top