+ Reply to Thread
Results 1 to 7 of 7

Search and Replace with ""

Hybrid View

brisardo Search and Replace with... 03-09-2017, 11:24 AM
Special-K Re: Search and Replace with... 03-09-2017, 12:04 PM
brisardo Re: Search and Replace with... 03-10-2017, 05:08 AM
jindon Re: Search and Replace with... 03-10-2017, 05:30 AM
brisardo Re: Search and Replace with... 03-10-2017, 08:17 AM
jindon Re: Search and Replace with... 03-10-2017, 08:54 AM
jindon Re: Search and Replace with... 03-10-2017, 08:54 AM
  1. #1
    Registered User
    Join Date
    01-13-2017
    Location
    Sweden
    MS-Off Ver
    2013
    Posts
    31

    Search and Replace with ""

    Hello all,

    I would like to know if you can help me again.

    I download a Excel file which has something like this in many cells:
    code.JPG

    I want to replace that using a macro to Relationship. I know you can use "" to start the name again but that seems to be not very efficient.

    Is there another way to do that?

    Maybe have another sheet with the long text in the A:A and the short text in B:B.

    Would be great if you could help me. Thanks in advance
    Last edited by brisardo; 03-09-2017 at 11:27 AM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: Search and Replace with ""

    No attachment?

    Attach a sample spreadsheet with expected results, remove any sensitive data, create a mockup example if necessary.
    Use the Go Advanced option at the bottom of the page then scroll down to Manage Attachments as the "paperclip" method does not work on this forum.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    01-13-2017
    Location
    Sweden
    MS-Off Ver
    2013
    Posts
    31

    Re: Search and Replace with ""

    Thanks for the tip. I added a file.

    I created a new sheet (search and replace) and maybe it is possible to replace everything in B:B with the data in A:A.

    Thank you very much in advance.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Search and Replace with ""

    Is this what you are after?
    Sub test()
        Sheets("raw data").Cells.Replace "<*>", "", 2
    End Sub

  5. #5
    Registered User
    Join Date
    01-13-2017
    Location
    Sweden
    MS-Off Ver
    2013
    Posts
    31

    Re: Search and Replace with ""

    Wow this was easy and fast. Thank you very much
    Just for interest what does the 2 mean?

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Search and Replace with ""

    The 3 rd argument, "LooAt" named argument, of Replace method has 2 constant values, 1 for xlWhole and 2 for xlPart.
    So it replaces "<*>", the every part that begin with "<" and end with ">" with "".

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Search and Replace with ""

    Delete see below.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Search and replace any words in a textbox that are on a "blacklist"
    By blake3393 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-26-2017, 05:01 AM
  2. replace all defined range names in the sheet that start with "Street" to "Road"
    By matrex in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 11-04-2016, 08:53 AM
  3. How to "Search and replace" a list of different names - multiple times
    By The Excel Noob in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2015, 06:10 AM
  4. [SOLVED] VBA help needed to remove all "/" then replace with "-" from cell "B3"and "B5"
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-17-2014, 02:11 PM
  5. Macro to search all worksheets in "find and replace" window
    By lkp88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2014, 07:30 PM
  6. 7 nested IF statements with a SEARCH added IF(ISNUMBER(SEARCH({"INSUR","AP REFUND"}
    By michaelproctor001 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 12-10-2013, 02:13 PM
  7. [SOLVED] Replace "insert function" with "edit formula" button in fourmula b
    By 13brian in forum Excel General
    Replies: 0
    Last Post: 08-24-2005, 04:05 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