+ Reply to Thread
Results 1 to 5 of 5

Replace text entries using code throughout the workbook.

  1. #1
    Forum Contributor
    Join Date
    03-25-2011
    Location
    London, England
    MS-Off Ver
    office 2021
    Posts
    317

    Replace text entries using code throughout the workbook.

    Hi Guys
    Does anyone know how I could have some code to replace various Text entries, varying number but about 20 throughout a workbook in the very same way the find and replace button works. The code would be on my machine so that when I circulated the workbook only the replacement text would be visible. And then of course to be able to use this to revert later.

    Knowing the power of Excel I am assuming this is possible. I have no idea at all where to start. Have popped up an excel workbook - only one sheet but you get the idea.

    Here's hoping.
    Mark
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Replace text entries using code throughout the workbook.

    You can use the find and replace button from within excel (turn on the macro recorder and see what code you get...) should be something like:
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Replace text entries using code throughout the workbook.

    Maybe:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    03-25-2011
    Location
    London, England
    MS-Off Ver
    office 2021
    Posts
    317

    Re: Replace text entries using code throughout the workbook.

    Hi Guys
    I had tried the first suggestion using the replace whilst the macro was running. What happened was the macro recorded the actual entry and this will vary. So I, at least could go that route.

    John your formula must have worked for you or you would not have uploaded it. I have put it in my workbook but I don't know how to run it. I have attempted to run it from View and to step into it. Stepping into it seems fine in that it goes through the steps but it makes not alteration on screen. Your code refers to other sheets so i created a second sheet and then ran it. hey Presto ran beautifully.

    This is not a big job for me or so i thought I have been "altering" a work book using the replace facility for each entry all morning. Because the process is tedious I become a little lazy about replacing the entries. So thanks again. Its a really nifty code.

    Mark

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Replace text entries using code throughout the workbook.

    You're welcome. Glad to help out, and thanks for the feeback and the reps.

+ 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. [SOLVED] Code to replace text as a part match
    By kenadams378 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-02-2012, 06:18 AM
  2. Code to replace closed workbook file name
    By Meli602 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-09-2008, 01:22 PM
  3. Replies: 7
    Last Post: 03-03-2008, 11:48 AM
  4. Code to replace text in a range of cells in a particular column
    By Zyphon in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-16-2007, 06:57 AM
  5. [SOLVED] How to replace vba code in one excel workbook from another workboo
    By ChrisSaw in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-17-2006, 12:50 AM

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