+ Reply to Thread
Results 1 to 4 of 4

Find and replace asterisk

  1. #1
    Registered User
    Join Date
    11-09-2011
    Location
    bombay
    MS-Off Ver
    Excel 2003
    Posts
    10

    Find and replace asterisk

    Hi

    I have a set of data in which asterisk is used as a separator. Asterisk being a wildcard character hinders with my search operation. I used the following code to replace the * with | as the separator.


    Please Login or Register  to view this content.
    When I run the code, it replaces all the asterisks in the sheet. I want to restrict the find and replace operation to a particular column (say B:B) / range (say A1:C10) alone. Is it possible to do that?
    Last edited by indimonk; 01-31-2012 at 05:26 AM. Reason: Marked as solved

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Find and replace asterisk

    Please Login or Register  to view this content.
    Last edited by protonLeah; 01-31-2012 at 12:14 AM.
    Ben Van Johnson

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Find and replace asterisk

    Hello indimonk,

    If you want to check only cells "B1:B10" in the Range("A1:C10") then the macro would be...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    11-09-2011
    Location
    bombay
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Find and replace asterisk

    Quote Originally Posted by protonLeah View Post
    Please Login or Register  to view this content.
    Thanks protonLeah. It works perfectly now. When I used Chr(42), it replaced the entire content of the cell. I have therefore continued to use ~*

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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