+ Reply to Thread
Results 1 to 5 of 5

Replace cell value from another cell value in VBA

  1. #1
    Registered User
    Join Date
    12-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question Replace cell value from another cell value in VBA

    I have an excel:

    A B C
    "ABC"."EF" "MNO" "YO"
    "XYZ"."BCD" "ABC" "GO"
    "MNO"."ABC"
    "ABC"."JKL"

    I want to check each column B in to column A. If B is matching with A then replace text of B into A with C.

    Final Result will be:
    A B C
    "GO"."EF" "MNO" "YO"
    "XYZ"."BCD" "ABC" "GO"
    "YO"."GO"
    "GO"."JKL"

    Kindly help to achieve this using VBA. I tried writing VBA using Replace function but not able to replace cell with cell value.

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Replace cell value from another cell value in VBA

    The following code requires adding Microsoft Scripting Runtime via Tools>References in order to use dictionaries

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Replace cell value from another cell value in VBA

    hi neonehal, much simpler option, please check attachment, press Run button
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Replace cell value from another cell value in VBA

    Quote Originally Posted by Olaf.Braxhoofden View Post
    The following code requires adding Microsoft Scripting Runtime via Tools>References in order to use dictionaries

    Please Login or Register  to view this content.
    it works!!!

    Thanks Alot Man!!! You are awesome!!!

  5. #5
    Registered User
    Join Date
    12-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    3

    Thumbs up Re: Replace cell value from another cell value in VBA

    Thanks Watersev!!!

    Your code was pretty easy and simple to implement!!!

+ 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