+ Reply to Thread
Results 1 to 3 of 3

A macro to replace Text.

  1. #1
    Registered User
    Join Date
    03-08-2016
    Location
    Canada
    MS-Off Ver
    2015
    Posts
    70

    A macro to replace Text.

    I would likea macro to replace several words in a entire workbook and because the work book will change daily and there may be over 100 different words I would like to consistently change daily which will be the same ones a macro trumps manually using find and replace.

    Sample of the words

    replace "NYM" with "New York"
    replace "TB" WITH "Tampa bay"

    There will be alot of them. I would love to see a code doing this that I can add words to.

    Thank you for any help

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: A macro to replace Text.

    I would set up a "Config" worksheet, with a table to store your old / new string values.

    Then you could use something like:
    Please Login or Register  to view this content.
    See attachment for worked example.
    Attached Files Attached Files
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    03-08-2016
    Location
    Canada
    MS-Off Ver
    2015
    Posts
    70

    Re: A macro to replace Text.

    This forum amazes me. Thank you sir!

+ 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. Using a macro to replace text and looping thru
    By Uvenata in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2016, 08:18 PM
  2. Macro for adding text, spacing, and a replace in a text string.
    By scapegoat9595 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2013, 10:44 AM
  3. [SOLVED] macro replace a string with certain text..?
    By adbasanta in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 03-09-2012, 09:40 AM
  4. Macro to replace text in Word with text from Excel
    By RemyLabue in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2009, 02:37 PM
  5. [SOLVED] Replace Number with Text using Macro
    By Carter68 in forum Excel General
    Replies: 3
    Last Post: 04-19-2005, 04:06 PM
  6. Macro to delete and replace a text box
    By Dave in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-24-2005, 07:06 PM
  7. Macro to delete and replace a text box
    By Dave in forum Excel General
    Replies: 0
    Last Post: 02-24-2005, 02:06 PM

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