delete rows vba

  1. N

    Delete Row IF condition is met, IF NOT proceed to next condition etc

    Hi everyone, I've been googling my heart out but still haven't found the VBA code / solution I am after. Let's say I've got 2 spreadsheets named spreadsheet1 and spreadsheet2. In spreadsheet1 there are hundreds of rows with relevant data and I have already turned the autofilter on. The unique...
  2. J

    Help!!!! Vba code to delete rows in one sheet based on criteria from another sheet...

    Hi I am a newbie to Excel VBA Coding so take it easy on me i this is a stupid question. So, I will try to explain what I need as best I can: So, I have a spreadsheet (we'll call it S1) that has over 3000 rows of data. Each row corresponds to a customer that has various customer related columns...
  3. M

    Delete Non-Contiguous Rows, Excel VBA

    I have a spreadsheet that users can only modify through userforms. One userform is meant to allow users to select entire rows of the spreadsheet and delete the data. My current code works when one row is selected or when one contiguous block of rows is selected, but fails when several non...
  4. L

    Select row of current selected cell (Excel 2007)

    Goal is to delete all rows from row 2 to the row of current selected cell. For example if I have select a cell in row 230 selected I want to delete rows("2:230"). I tried ActiveSheet.Rows("2:" & row_number).Delete. But this give me a Run-time error '13': Type mismatch. Any help would be...
  5. M

    Code to delete row when certain criteria met

    Hello Again Forum, I am trying to delete rows when ever a cell in column G says "No Data" and a cell on the same row in column E is blank. Below is my code: lRow = Cells(Rows.Count, "A").End(xlUp).Row Do While lRow > 0 If Cells(lRow, 7) = "No Data" And Cells(lRow, 5) = "" Then...
  6. P

    VBA to identify one criteria then delete rows based on another

    I have some simple VBA that highlights the entire row if fields in a column match a certain criteria, however, I would now like the VBA to look at the cells in another column that have been highlighted and delete the row if the cell contains the same value above or below. See example below, rows...
  7. T

    Trying to delete rows from a very large spreadsheet

    I am a novice at VBA and trying to figure this out with no luck. I currently use Excel 2003. In a very large workbook, I would like to find all rows that are more than three years old, or older than a certain date, and delete that row. There are roughly 360 worksheets in the workbook...
  8. B

    Deleting rows not containing value

    I am trying to delete all rows until the macro reaches the row that contains "Loan Detail" in column A. I am using the following code, it seems to find the row but deletes it. I want it to delete UNTIL reaching that row. Any input? Sub DeleteRow() Dim F Dim MyValue MyValue = "Loan Detail"...
  9. R

    Delete 2 last rows

    I need to delete my 2 last populated rows, i have this code: Range("B" & Rows.Count).End(xlUp).Offset(1).Select that will select the row right below the last populated cell. I need the macro to select the two rows above the one that the code selects, and delete it! THANKS!

Some videos you may like

This Week's Hot Topics

  • Use Filter function with 2 criteria to return a specific value
    I've spent many hours trying to find out why the basic formula for Filter function with 2 criteria will not return a value other than #CALC. I'm...
  • Loop stopping at row 10
    Below is a code I had a lot of help with from user such as yourself. This code worked well but now is stopping a row 10 and I can't see why! Could...
  • Numerical Order Code for Macro
    I am trying to find a code or fix what i have on the macro that will automatically make the certain column generate in numerical order when I...
  • Calculate time in excel
    I get a text report from our time keeping system that i dump into excel through a data connection and I need to calculate the total hours for a...
  • VBA
    Hello everyone, I need your help please. I just need VBA code to get my reports working. What I want to do is whenever these dropdowns are...
  • Help with formula to sum numbers prior to date
    Hello, I was hoping to get some assistance as I'm having trouble with this. Using my table below as an example, how could I write a formula which...

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
Top