delete rows

  1. P

    "For x = 2 to finalRow Step 1" ignores deleting certain criteria. Please help.

    Hello VBA world, I wrote a macro to delete code NOT equal to "XXX" in Column F. When I run the for loop, it keeps certain items that should not be kept... in other words, only data rows with symbol XXX should be left but this loop leaves data rows that should be left after the macro has been run...
  2. L

    Delete Method of Range Class Failed, Run-time Error 1004

    Hi everyone, This is my first post so I hope someone can help me out. The VBA macro that I have written is essentially a glorified transpose function (the specifics shouldn't be important for my question). Midway through the code I need to delete a large range of cells so that a) the formatting...
  3. K

    Deleting Row from Sheet 2 if Sheet 1 condition True

    Dear All, I have different sheets Called "Master", "AD", "E-mail", "Internet". I like to make it in a way that If I change master sheet it will reflect in the other sheet. As if I change ABC AD value to No the it will delete all the ABC Name Rows from the other sheets as well. Maseter...
  4. R

    Deleting rows that meet specific criteria

    I have a simplish problem that I hope has an equally simple answer - I've been using clumsy work-arounds to deal with it, but I KNOW there has to be a better way. Here it is: I often use a loop to delete rows that meet certain criteria. For example: For i = 1 to x If Cells(i, 3).Value =...
  5. G

    VBA code for cut and paste in a loop

    Hi Knowledgeable people I am a novice Excel VBA user who is trying to create a cut and paste procedure that moves every second cell in a column of data up adjacent to the first cell and then deletes the blank line. ie. Raw data in column A is: Number 1 Description 1 Number 2 Description 2...
  6. P

    difficult problem

    I'm trying to delete rows in a table (the table is located in the middle of a worksheet and does not begin in cell A1). This is a dynamic table where each row in the table needs to be able to change. In other words, the named range Menuitem1 is on another worksheet in the workbook. But in this...
  7. B

    Suspend Code When Row is Deleted

    I am running the following to automatically date stamp a range of data when anything in its respective row is modified: Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("A2:AA7000")) Is Nothing Then Exit Sub Application.EnableEvents =...
  8. D

    Frustrated with VB Code

    I've been failing all day exhausting all possible reasons that this code won't do as I ask. Please help me! In column BB, there can be the following things: shift stub_shift job stub_job I want to delete all rows that do not contain "shift". Easy enough right? <-------- WRONG Dim lRow As...
  9. D

    Using Countif with wildcard to delete rows

    Hi there, I am a VBA novice and I would greatly appreciate some help. I am using Countif in a relatively simple macro to identify if a cell contains a particular string. The idea is to delete the row if the string is present. So for example the two lines of code would read: If...
  10. J

    Deleting Rows if the Row Contains Specific Text

    I am trying to figure out how to delete a whole row if the row contains the text "Run Date". However, the cell with that text will also have varying text before and after run date. I tried using the below, but it won't work since my cell doesn't contain exact text.
  11. O

    Delete rows based on range of values found in Column A

    Hi Guys, I'm SO new to this, I don't even really understand how to put macros into the Excel coding section. :confused: I want to delete all the rows that show anything BUT a value between 300 and 400 in column A. I was trying to modify some of the other 'delete row' codes that have been...
  12. B

    Delete Cells If Does Not Equal Criteria

    Hi, Am writing a Sub that will delete all rows that do not contain 1 in Column B. So far i have Sub Macro14() Dim ws As Worksheet Set ws = ActiveSheet For i = ws.Range("B5").End(xlDown).End(xlUp).Row To 1 Step -1 If ws.Cells(i, 2) <> "1" Then ws.Rows(i).Delete End If...
  13. T

    Deleting Rows Based on Value of a cell, HELP!!!!

    Hello Excel People, I have the following VBA code which i cant quite get to work as i want it to. What i am trying to achieve is for Excel to look at all rows that have an 'x' in column G. Then for those rows delete the cells in column A-E. So..... If row 5 had an 'x' in cell G5 then Excel...
  14. F

    Deletes rows that do not have a specific word in a specific column

    Here is the code I am using but can not make it viable to a specifc column. Sub Delete_Rows() ' This macro deletes all rows on the active worksheet ' that do not have Versaold in column F. Dim Rng As Range, cell As Range, del As Range Dim strCellValue As String Set Rng =...
  15. K

    Macro to find text then delete all rows below

    Hi, I have a spreadsheet which contains the words HM or NON HM in column A. I have wrote macro to sort data so HM comes first but what I want to do now is have a macro which finds the first instance of NON HM, then deletes that row and all subsequent rows below. Can anyone help?
  16. D

    Find empty cell in range and copy range next to it

    I need some help on writing a code that finds any empty cell in a range ("Q4:Q46") and then cuts the cells ("A:P") in that same row and paste it to another sheet starting with cell ("A4"). Then delete the rows that the data was cut from. This code will be linked to a command button. Any help...
  17. T

    Macro to find a cell value, select and delete, and loop thru all instances

    Hi, I'm a VBA rookie who's banging his head on his desk w/this one: (I'm running Excel 2007 on Win XP) I have a worksheet that has data similar to this in Column A: Data Type A A B C Data Type B A B C Data Type A A B C ...and so on... Note that in my data set I'm working with the A,B,C...
  18. D

    Compare and Delete

    Dataset 1 Workbook 1 (name varies)--> Worksheet 1 --> Column A --> Cell 2 thru (varies - can be hundreds or thousands) Dataset 2 Workbook 2 (Rlistsort) --> Worksheet 1 --> Column A --> Cell 2 thru (currently 250 but will continue to increase) Need to compare Column data in Workbook 1 to Data...
  19. C

    Delete Rows based on Criteria

    I am running Excel 2003 on Windows XP. I would like to perform the following Vlookup(c6,'Sheet 2'!a1:b43300,2) The Vlookup would be used for rows d6:d81 on Sheet 1. Each following vlookup would be the same format (e.g. Vlookup(c6,'Sheet 2'!a1:b43300,2)). C6 represents a zip code with a...
  20. M

    Keep/delete rows, condition based

    In a csv file, when running the macro, an input field must appear. After typing X into this field: All rows containing A and X: the row should be kept if a row contains A, but not X: the row must be deleted A row contains B and X: kept A row contains B, but not X: deleted All rows not containig...

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