Results 1 to 20 of 20

delete rows when column has specific word(s)

Threaded View

  1. #1
    Registered User
    Join Date
    09-21-2013
    Location
    portland,maine
    MS-Off Ver
    Excel 2007
    Posts
    8

    delete rows when column has specific word(s)

    Super noob

    I have been trying to delete specific word in say column H say the word springfield

    have tried a few scripts but it deletes data from column F

    please help
    here is what I have

    Sub Macro1()
    
      Dim FoundIt As Range
      Dim Rng As Range
      Dim SearchWord As String
      
        SearchWord = "ABC"
        Set Rng = Columns("B:B")
        
          Set FoundIt = Rng.Find(What:=SearchWord, _
                                 After:=Rng.Cells(1, 1), _
                                 LookIn:=xlValues, _
                                 LookAt:=xlWhole, _
                                 SearchOrder:=xlByRows, _
                                 SearchDirection:=xlNext, _
                                 MatchCase:=False)
                                 
          If Not FoundIt Is Nothing Then
             Set FoundIt = FoundIt.Resize(Rowsize:=5)
             FoundIt.EntireRow.Delete
          End If
             
    End Sub

    thanks in advance for any direction/help
    Last edited by alansidman; 09-21-2013 at 10:42 PM. Reason: Added code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Macro to delete rows that DO NOT contain specific word
    By enfieldsteve in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-19-2013, 10:59 AM
  2. [SOLVED] Need a macro to delete rows with specific word
    By renjithvakkayil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-07-2013, 12:54 PM
  3. Delete rows or Clear contents below a specific word is found in Column A
    By kishoremcp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-17-2012, 04:08 PM
  4. Delete all rows that dont contain a specific word.
    By BPSJACK in forum Excel General
    Replies: 4
    Last Post: 03-15-2012, 05:05 AM
  5. Macro to look for a specific word and delete rows
    By excelaspire0219 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-27-2009, 06:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1