+ Reply to Thread
Results 1 to 2 of 2

VBA to find and replace from separate workbook / sheet

  1. #1
    Registered User
    Join Date
    MS-Off Ver

    VBA to find and replace from separate workbook / sheet

    I am currently trying to find a Macro that can be used to find and replace multiple values in one cell (the cell content and location can change). I am a complete novice, and am really not sure what I am doing!

    I have Sheet1 that contains the following information:

    A B
    1 This is
    2 The text
    3 I would like to be copied
    4 Into my workbook
    50 in full

    In another sheet in the workbook (which is re-named frequently) I have cells with multiple numerical values which correspond to the text in cell B. E.g. in G4 I will have: 1, 2, 3, 50

    I would like to run a macro which looks up the numbers in selected cell(s), and replaces it with the text. So:
    1, 2, 3, 50 should become: This is, The text, I would like to be copied, in full

    I currently have VBA code that successfully finds and replaces the values, but only up to 9. Then it starts replacing only part of double digits (10, 11 etc.) I know that this is due to:
    LookAt:=xlPart in the VBA but when changed to
    xlwhole, it does not work at all.

    Please Login or Register  to view this content.
    I am not sure how to change the code to allow it to find and replace numbers past 9... if there is anyway anyone could help, that would be great!

    Thank you in advance!
    Last edited by 6StringJazzer; 03-12-2018 at 02:48 PM. Reason: code tags

  2. #2
    Forum Moderator 6StringJazzer's Avatar
    Join Date
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 2209 64-bit

    Re: VBA to find and replace from separate workbook / sheet

    Welcome to the Forum Bowler112!

    I am sorry to tell you that you have broken two of our rules in your first post. I would ask you to please take the time to review our rules. There aren't many, and they are all important.

    The first rule is that if you have posted the same question to another site, that you include a link here so that people do not duplicate effort. I am going to ask you to post that link here before you get further responses.

    Your post does not comply with Rule 8 of our Forum Rules: Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you must provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (most other forums have the same rule).

    The second rule requires CODE tags when you include code in your post. I have added them for you this time because it's your first post. Your post does not comply with Rule 3 of our Forum Rules: Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7.
    | | |?| |?| |?| |?| | |:| | |?| |?|
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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. Need VBA macro "find replace" from list on sheet 1 cycling through the entire workbook
    By DBaseBeginner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-22-2015, 11:26 AM
  2. Replies: 0
    Last Post: 08-06-2015, 10:33 AM
  3. [SOLVED] Find value in separate sheet, offset and replace original cell value
    By Aaron092 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-30-2014, 07:34 AM
  4. [SOLVED] Find and Replace Macro- Within Workbook or Sheet
    By Rhudi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2013, 12:53 PM
  5. Find replace based on data from a separate list
    By shawnsonline in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2012, 02:46 PM
  6. Copmpare/Find and replace cells in two separate workbooks across multiple sheets
    By jmarrxx in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-07-2012, 09:53 AM
  7. Select sheet tabs in workbook & save to separate workbook files
    By stratocaster in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-01-2006, 11:40 AM

Tags for this Thread


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