Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: Removing * from the end of text

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Posts
    83
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Please help.
    I have a list of companies and some have a * at the end of them. When I run the code below it deletes the whole name, even if the matchcase is set to false.

    Any ideas???
    Thankyou in advance for your help!!!!



    Worksheets(1).Columns("b").Replace _
    What:="*", Replacement:="", _
    SearchOrder:=xlByColumns, MatchCase:=True

  2. #2
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    83,645
    Post Thanks / Like
    Mentioned
    33 Post(s)
    Tagged
    6 Thread(s)

    Default

    On 2002-04-25 03:08, Steve Jukes wrote:
    Please help.
    I have a list of companies and some have a * at the end of them. When I run the code below it deletes the whole name, even if the matchcase is set to false.

    Any ideas???
    Thankyou in advance for your help!!!!



    Worksheets(1).Columns("b").Replace _
    What:="*", Replacement:="", _
    SearchOrder:=xlByColumns, MatchCase:=True
    Did you also try Data|Text to Columns with * as delimiter?

    Aladin

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Location
    Midlands, UK
    Posts
    217
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try putting a ~ ( tilde ) befoer the * eg :

    Worksheets(1).Columns("b").Replace _
    What:="~*", Replacement:="", _
    SearchOrder:=xlByColumns, MatchCase:=True

  4. #4
    Board Regular
    Join Date
    Apr 2002
    Posts
    83
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thank you the ~ works fine.

    Many thanks

    Steve

  5. #5
    Board Regular
    Join Date
    Apr 2002
    Posts
    83
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thank you the ~ works fine.

    Many thanks

    Steve

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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