+ Reply to Thread
Results 1 to 4 of 4

VBA to find and replace?

  1. #1
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    300

    VBA to find and replace?

    I have a document which the end user will edit to their needs by adding their company name.
    I was looking for a way of allowing them to enter their company name on the "cover" and it
    would autopoulate throughout the document. I know you can do it with building blocks but
    that seems to require user intervention.
    Is there a foolproof way to make this work? Sure I have seen it but have no idea what it it called
    I wondered if a find and replace macro is the way to go? ie find Company replace with The Company
    could this run so that they type company name and press enter to find and replace?
    Last edited by And180y; 07-04-2021 at 06:23 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    36,808

    Re: VBA to find and replace?

    You could use a Worksheet Change Event handler on the "cover" sheet monitoring the Company Name. When it is changed, you can loop through all the sheets changing the company name cell(s).

    Or, you could just link the company name cell(s) in all the other sheets to the company name cell on the cover sheet, for example,
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    That would be a simpler approach (if your sheet layouts are static)

  3. #3
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    300

    Re: VBA to find and replace?

    Thanks Trevor, Word isn't my strong point so will go with your formula. :-)

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    36,808

    Re: VBA to find and replace?

    You're welcome. Thanks for the rep.


    Word? Oops Ö didn't pay attention and assumed it was Excel

    Sure you can do something similar in Word but not my strong point.

    Maybe this will help: https://superuser.com/questions/2228...fields-in-word

+ 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] Find and Replace Macro to replace list of special characters
    By dcowiesmith in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-22-2021, 02:01 PM
  2. Replies: 0
    Last Post: 02-13-2021, 03:32 AM
  3. [SOLVED] Using find replace to first find two double quotes and replace with a single double quote
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-17-2015, 10:13 AM
  4. [SOLVED] Find and replace where contents a formula so can't be seen by Find and replace.
    By markDuffy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-26-2015, 02:24 PM
  5. Replies: 16
    Last Post: 12-02-2014, 03:38 PM
  6. Replies: 3
    Last Post: 11-25-2014, 06:08 AM
  7. find in excel replace in word: find/replace text in text boxes and headers
    By dean.rogers in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2012, 12:40 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