+ Reply to Thread
Results 1 to 2 of 2

How to Assign Value to a String & Replace String With Assigned Value?

  1. #1
    Registered User
    Join Date
    02-21-2012
    Location
    Surrey, Canada
    MS-Off Ver
    Excel 2007
    Posts
    1

    How to Assign Value to a String & Replace String With Assigned Value?

    I have two sheets in my workbook
    Sheet 1:
    Column 1 | Column 2
    abc | 2
    xyz | 3
    dki | 4

    and many rows following…
    How do I assign the variables in column 1 with the values in column 2 for the entire columns?

    Sheet 2:
    | Column 1 |
    | cde |
    | cfe |
    | cdx |

    and many rows following…

    How do I automatically replace the strings in column 1 (sheet 2) with the assigned value (in sheet 1) if the string matches with the variables set in sheet 1, and if the string doesn’t match any variables in sheet 1, 0 will replace the string.

    Or is there an easier way to achieve this?

    Thanks in advance!!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to Assign Value to a String & Replace String With Assigned Value?

    MASS REPLACE
    Here's a macro for searching for a series of values/strings and replacing them with a new set of values/strings:

    Mass Replace
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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