+ Reply to Thread
Results 1 to 6 of 6

find and replace specific characters

Hybrid View

  1. #1
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: find and replace specific characters

    maybe
    Sub Macro1()
    
    
    Set rng = ActiveSheet.UsedRange
    With rng
        rng.Replace What:="(", Replacement:="", LookAt:=xlPart
        rng.Replace What:=")", Replacement:="", LookAt:=xlPart
     End With
    End Sub
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: find and replace specific characters

    Sub FORMATUSERS()
       ActiveSheet.Name = "user_info"
     
       With Sheets("user_info").UsedRange
        .Replace "(", "",xlpart
        .Replace ")", "-",xlpart
       End With
    
        with cells(2,42).end(xldown).resize(,19)
          .replace "T",cells(1,42), xlwhole
          .Replace "F", "", xlWhole
       end with
    
      with columns(1)
         .replace "not used", ""
         .specialcells(4).entirerow.delete
         .specialcells(2).replace  " ", "_"
         .specialcells(2).replace "|", "_"
      end with
    End Sub

  3. #3
    Registered User
    Join Date
    08-12-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: find and replace specific characters

    This worked perfectly.

    Thank you forum!

    Sub Macro1()
    
    
    Set rng = ActiveSheet.UsedRange
    With rng
        rng.Replace What:="(", Replacement:="", LookAt:=xlPart
        rng.Replace What:=")", Replacement:="", LookAt:=xlPart
     End With
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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