+ Reply to Thread
Results 1 to 3 of 3

How to vlookup a Column contain special character and replace it?

  1. #1
    Registered User
    Join Date
    06-22-2013
    Location
    HongKong
    MS-Off Ver
    Excel 2010
    Posts
    1

    How to vlookup a Column contain special character and replace it?

    Hi,

    I would like to know how can I lookup a cell value which if contains special character, replace it with the cell value beside of it.

    For example:
    Column A Column B
    ====== ========
    txt1 text1
    tet2? text2
    text3 text3
    text?4 text4

    In this example, row2 and row4 contain "?" special character, I would like to replace it with the value beside of that cell.

    In this case,
    "tet2?" will be replace to the value "text2".
    "text?4" will be replace to the value "text4".

    Others remains unchanged.

    Could anyone please kindly help me?
    Thanks.

    Mandy

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: How to vlookup a Column contain special character and replace it?

    Try this small macro:

    Please Login or Register  to view this content.

    Macros are very easy to install and use:
    1. ALT-F11 brings up the VBE window
    2. ALT-I
    ALT-M opens a fresh module
    3. paste the stuff in and close the VBE window
    If you save the workbook, the macro will be saved with it.
    If you are using a version of Excel later then 2003, you must save
    the file as .xlsm rather than .xlsx

    To remove the macro:
    1. bring up the VBE window as above
    2. clear the code out
    3. close the VBE window
    To use the macro from Excel:
    1. ALT-F8
    2. Select the macro
    3. Touch RUN
    To learn more about macros in general, see:

    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    Macros must be enabled for this to work!
    Gary's Student

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16
    Posts
    49,991

    Re: How to vlookup a Column contain special character and replace it?

    Hi and welcome to the forum

    Have you considered just using plain 'ol find-and-replace?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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