Results 1 to 7 of 7

Delete other values except "A" and "B" and "C"

Threaded View

  1. #1
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,014

    Delete other values except "A" and "B" and "C"

    Greetings,
    I have following code in the enclosed file.
    Sub Macro1()
    Sheets("Sheet1").Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row).Replace What:=">", Replacement:="", lookat:=xlPart
    Sheets("Sheet1").Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row).Replace What:="BT", Replacement:="", lookat:=xlPart
    Sheets("Sheet1").Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row).Replace What:="p", Replacement:="", lookat:=xlPart
    Sheets("Sheet1").Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row).Replace What:="t", Replacement:="", lookat:=xlPart
    Sheets("Sheet1").Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row).Replace What:=" ", Replacement:="", lookat:=xlPart
    Sheets("Sheet1").Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row).Replace What:="  ", Replacement:="", lookat:=xlPart
    End Sub
    Open enclosed file and run Macro1 in order to understand what Macro1 is doing...

    I need a macro which will do same operation of Macro1 but
    delete other values except "A" and "B" and "C"
    or
    replace other values except "A" and "B" and "C" to nothing.

    So, my aim is to shorten a Macro1.
    Best wishes.
    Attached Files Attached Files
    Last edited by HerryMarkowitz; 01-10-2014 at 07:49 AM.
    Sub DontForgetThese()
         If Your thread includes any code Then Please use code tags...
         If Your thread has been solved Then Please mark as solved...
         If Anybody has helped to you Then Please add reputation...
    End Sub

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  2. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  3. Replies: 0
    Last Post: 01-09-2013, 06:52 PM
  4. Replies: 3
    Last Post: 02-16-2011, 02:55 PM
  5. Replies: 7
    Last Post: 05-13-2006, 05:02 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