Results 1 to 9 of 9

Locate Specific Text and Delete the Entire Row

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Canada
    MS-Off Ver
    Office 2010
    Posts
    129

    Locate Specific Text and Delete the Entire Row

    Hello,

    I have a macro written where the process works except for my last few steps, what I would like to do at the end is locate any of the following strings (please note these digits are imbedded in a longer number string - ex. 12-300-22000-5678 in Column V and delete the entire row once found....
    22000
    22005
    22025
    60-

    Here is my macro

    Sub ConcurExtractError()
    '
    ' ConcurExtractError Macro
    '
    ' Keyboard Shortcut: Ctrl+c
    '
        Sheets("Concur Extract Errors").Select
        ActiveWindow.SmallScroll Down:=-12
        Cells.Select
        Cells.EntireColumn.AutoFit
        Range("E6").Select
        ActiveWindow.SmallScroll Down:=-3
        Columns("M:M").Select
        Selection.Replace What:="", Replacement:="No Description", LookAt:=xlPart _
            , SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
            ReplaceFormat:=False
        Range("V24").Select
        ActiveWindow.ScrollColumn = 2
        ActiveWindow.ScrollColumn = 3
        ActiveWindow.ScrollColumn = 4
        Columns("W:W").Select
        Selection.Replace What:="", Replacement:="Delete", LookAt:=xlPart, _
            SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
            ReplaceFormat:=False
        Range("V13").Select
        ActiveWindow.ScrollColumn = 3
        ActiveWindow.ScrollColumn = 2
        ActiveWindow.ScrollColumn = 1
        Cells.Select
        ActiveSheet.Range("$A$1:$Z$341").RemoveDuplicates Columns:=22, Header:=xlNo
        Range("M13").Select
        ActiveWindow.SmallScroll Down:=-12
        ActiveWindow.ScrollColumn = 2
        ActiveWindow.ScrollColumn = 3
        Range("M14").Select
        ActiveWindow.SmallScroll Down:=-12
        If .Value = "20000" Then .EntireRow.Delete
        If .Value = "22005" Then .EntireRow.Delete
        If .Value = "22025" Then .EntireRow.Delete
        If .Value = "60-" Then .EntireRow.Delete
        
    End Sub
    Thank you very much
    Last edited by leebird; 12-01-2015 at 01:19 AM. Reason: Attachment Added

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Delete entire row for specific words
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-01-2015, 07:43 PM
  2. [SOLVED] How to locate specific text within a cell, starting from the right
    By SimplySA in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2014, 04:27 AM
  3. [SOLVED] Locate column with specific title and delete rows if predefined set of text is found
    By johnny_tc in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-25-2012, 01:57 PM
  4. [SOLVED] Macro: Locate specific text within supplied range
    By darrenkaye in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-17-2012, 01:03 PM
  5. Locate a reference in a table based on specific words on a text
    By zetavares83 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-06-2012, 06:17 PM
  6. Locate row above cell with specific text, and apply formatting?
    By HelenW in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-08-2009, 11:09 AM
  7. Locate and delete specific cells
    By David Smith in forum Excel General
    Replies: 1
    Last Post: 01-19-2005, 01:06 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