1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Macro Multiple Find and Replace in Excel 2010

Discussion in 'Business Applications' started by rweb, Dec 21, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. rweb

    rweb Thread Starter

    Joined:
    Dec 21, 2011
    Messages:
    9
    HI,

    I have a huge product listing that i need to find and replace on a mass scale. I have one spread sheet that has 3 columns (see example below)


    Column A****************Column B**********************Column C
    1************************ M2123*************************M3455
    2************************M3455*************************M3455
    3************************M3433*************************M3455
    4************************M6543*************************M3433
    5************************M8793*************************M3433
    6************************M6543*************************M7832
    7************************M7832*************************M7832
    8************************M4893*************************M7832
    9************************M3938*************************M2123
    10**********************M4837*************************M2123
    *********************************************************M2123
    *********************************************************M2123
    *********************************************************M4837



    In essence Column A is the id for column B (A=B), column C is longer than column a and b, because it contains duplicate (M)numbers. I would like to use the defined id in column a to replace the (M)numbers in columns c

    So the spread sheet with the end result would look like this

    Column A****************Column B**********************Column C
    1************************ M2123*************************2
    2************************M3455*************************2
    3************************M3433*************************2
    4************************M6543*************************3
    5************************M8793*************************3
    6************************M6543*************************7
    7************************M7832*************************7
    8************************M4893*************************7
    9************************M3938*************************1
    10**********************M4837*************************1
    *********************************************************1
    *********************************************************1
    *********************************************10


    Any suggestions?
     
  2. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    Hi, welcome to the forum,
    Maybe it's my not understanding your explanation, but is doe not make any sense and I don't understand what you want.
    The data you posted does not shed any light on it either.
    A small Excel sheet would probably tell more
    Sorry
     
  3. rweb

    rweb Thread Starter

    Joined:
    Dec 21, 2011
    Messages:
    9
    Thanks for your reply. Sorry for the confusion, i hope the attachment is helpful. Please let me know.
     

    Attached Files:

  4. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    I hope I got it right.

    The macro is in Sheet1's VBA and is named YourQuestion.
     

    Attached Files:

  5. rweb

    rweb Thread Starter

    Joined:
    Dec 21, 2011
    Messages:
    9
    HI Hans,

    I tried opening your file going to tools, macro and run YourQuestion macro and it doesn't change anything.
    Please advise?
     
  6. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    Have you enabled the macro's?

    It works fine here
     
  7. rweb

    rweb Thread Starter

    Joined:
    Dec 21, 2011
    Messages:
    9
    Yes, i enabled it. When i go to tools macro and run YourQuestion Macro it Display a message that says Microsoft Visual Basic
    400

    The info in the cells remains the same.

    Please advise?
     
  8. rweb

    rweb Thread Starter

    Joined:
    Dec 21, 2011
    Messages:
    9
    Sorry Han, i tried it on a pc and appears to work fine. I will give you an update after i test it out.

    Thanks
     
  9. rweb

    rweb Thread Starter

    Joined:
    Dec 21, 2011
    Messages:
    9
    Han it works Great!! Thanks
     
  10. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    :)

    Don’t forget to mark your own threads solved using the button at the top of the page of the thread in the upper left corner
     
  11. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1032256

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice