delete rows

  1. G

    Delete rows depending on number of columns

    Hi, I would like to know how one can delete multiple rows depending on the number of columns that they have. For eg. say I have 100 rows and the number of columns with data are different for each row. Now I only want rows that have exactly 10 columns with data and delete the ones that dont meet...
  2. A

    VBA doesn't remove all the rows

    Hello all, I have this code that does what it's supposed to, but it requires me to run the code several times, I am just trying to see what I can improve upon to make this code run completely the first time. Sub deleteNonBank() Dim R As Long Dim Lastrow As Long Lastrow =...
  3. G

    Delete rows if (certain value) exists in data set.

    Hello, I've been trying to delete rows in my data set that contain the following keyword "lename" This is the following script I found and the following error Script : Sub Delete_All_Rows_IF_Cell_Contains_Certain_String_Text() Dim lRow As Long Dim iCntr As Long lRow = 150000...
  4. D

    deleting rows based on a condition

    Can someone point me to a vba process that would spin thru column "A" and delete any row where only one (type) is found. in the following there are two web01, web02 web03 and app03, so they would remain. Only one row is found for app01 and app02 so they would be deleted. Suggestions would...
  5. K

    Speed Up Macro Segment

    Hello, I have a very long macro that's taking a REALLY long time to run (so long that my computer goes into standby mode while it runs). I narrowed the problem area of the code down to the segment below, and am wondering if anyone has any tips on how to make this more efficient. It does what...
  6. J

    VBA to delete rows based on empty cell

    Hi. Brand new here and to the world of VBA and MACROS. I need help with a certain situation I have. I have a workbook with twelve worksheets, sheet 1 - sheet 12. A lot of data but what I need to concentrate on is column d. I would like assistance with a vba code that would delete the...
  7. K

    Macro deleting top-down or bottom-up?

    Is this macro deleting rows from the top down, or from the bottom up? How can you tell? For r = ThisWorkbook.Sheets("New Data Add").UsedRange.Rows.Count To 1 Step -1 If Cells(r, "F") = "Status History" Then ThisWorkbook.Sheets("New Data Add").Rows(r).EntireRow.Delete End If Next
  8. A

    Deleting rows based on multiple different values....

    I have a sheet of about 1000 rows ... So there are 11 rows of Master Order numbers but only 5 different Master Orders. Some Master orders have Slave orders, some do not. If a Master order has a Status of 12, 13 or 14 or a Type of 02 I need to remove that row. The problem Im having is...
  9. A

    VBA delete rows based on date

    I need help creating a VBA code that will delete rows based on a date. If possible, I would like for the code to delete the rows from the previous month. I want it to be dynamic so that it will work with any previous vs. current month. For Example: I have June 2019 and July 2019 data. Is it...
  10. L

    Delete Rows by Speciic Date Set in the Code

    I have a spreadsheet with rows of data sorted by date. I need to delete rows older than a specific date I want to set in the code, not an input box. Let's say 12/07/2018. The dates are currently in Column F. I'd like to set the column in the code as well. It could change. There are hundreds of...
  11. B

    Excel VBA to Delete Rows Based on Date & Time

    <tbody> F G 1 DATE TIME 2 2/19/2019 18:00 3 2/19/2019 23:20 4 2/19/2019 3:30 5 2/20/2019 6:30 6 2/20/2019 7:00 7 2/20/2019 8:00 </tbody> I'm having trouble deleting rows based on date & time. I have a report that exports transaction dates and times in...
  12. F

    Delete Blank Rows

    I need code that will: Find the first blank row in a set of data (the first blank row is ALWAYS at the bottom end of the data) Highlight that row and every row below it Delete I tried this code: 'Columns("A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete (I use Column A because that always...
  13. T

    Compare 2 Rows in Power BI and Delete Matched Rows

    Please see below scenarios and provide your suggestions, My data source is in Oracle to power bi and as per my requirements I need to compare order no rows, if order number has .1 then I need to find order number without .1 and delete both rows. Does any one has any suggestion...
  14. Johnny Thunder

    VBA Help - Any way to speed up this code? - Delete Rows Based on Cell Value

    Hi Gang, Wanted to see if anyone has a way of speeding up a working code. Currently it takes 3-5min on my PC to run this code. Was hoping for a more time efficient update to make this faster, any suggestions are appreciated. What it does: Looks at column B on my worksheet and finds any cells...
  15. P

    How can I delete hidden rows after filter has been set?

    Hi, I currently have a workbook with multiple sheets that have a macro running to set a filter based on specific criteria from the main sheet. I would like to be able to have all items that are not a part of the filter (hidden) be deleted from the supporting sheets in an effort to reduce the...
  16. C

    Using VBA to reference the date in cell in a different sheet

    Hello! I am very new with VBA and am currently working on writing a macro that deletes all the rows in a sheet, that hold a date that falls on or before 6/1/18. Here is what I have so far... Sub Macro2() With ActiveSheet .AutoFilterMode = False With Range("g1", Range("g" &...
  17. R

    Delete every 2nd and 3rd row

    I have an excel column with about 5000 rows of text. Is there a quick way to delete every 2nd and 3rd row? There is nothing in the text that would allow me to filterin a smart way. Currently 1 2 3 4 5 6 etc. I need to delete rows 2,3 5, 6 and so on. Thanks
  18. M

    Trying to delete rows that do not contain specific text

    Hiya. I am having fun learning this vba stuff! But, I'm stuck. My Book contains businesses and address info, like this: <style>table { }tr { }col { }br { }td { padding-top: 1px; padding-right: 1px; padding-left: 1px; color: black; font-size: 12pt; font-weight: 400; font-style: normal...
  19. S

    Find specific value, loop through rows and delete rows.

    Hey All, Hope you can help me with this code. When a user clicks a button, the routine is looking for the second highest value. In the next step the range is selected, color is set from red tot black, no strikethrough and cells are no longer locked. This works fine, the routine starts from cell...
  20. J

    Macro to Delete Rows (multiple criteria)

    I have a worksheet consisting of approximately 50,000 rows and 30 columns (A - AD). Each column has a heading. I need a macro that will quickly delete all rows that don't contain specific text in Column C. Column C will have names of schools, elementary, middle, and high. There are approximately...

Watch MrExcel Video

This Week's Hot Topics

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