+ Reply to Thread
Results 1 to 4 of 4

A mod needed in Find and Replace -code

  1. #1
    Registered User
    Join Date
    11-27-2017
    Location
    Kokkola, Finland
    MS-Off Ver
    Excel 2016
    Posts
    3

    A mod needed in Find and Replace -code

    Hi,

    I'm new to Excel programming and I would need some help with one issue.
    I have found a very useful multi find and replace code which can be found here:
    https://www.extendoffice.com/documen...t-once.html#a1

    The code is as follows:

    Please Login or Register  to view this content.
    So the code is simply a find-replace function but with multiple attributes at once.

    I would like to modify the code so that I would have a dedicated attribute excel which would contain this code and the find-replace-attributes and the search-range would be in a different folder. And the code should also work in a way that it scans through all the sheets in a file. That way the code would be as powerful as possible.

    I believe that it shouldnt be that hard to do but I'm not familiar with excel programming so for me it is impossible.

    In a nutshell:
    1) C:/FIND_REPLACE/ would contain the search document. Lets call it Find_replace_attributes.xls
    2) Find_replace_attributes.xls is a file which contain the attributes and the search algorithm. Column A would contain all the "find" attributes and column B would contain the "replace" attributes.
    3)Code would automatically scan through all the column A cells which contain an attribute. (the code scales itself)
    4)Code scans through a particular folder, for example C:/Find_replace/Files/
    5)Code scans through every single excel file and its all contents (not affecting the text sizes, fonts etc.)
    6)Code also produces a report about what it has done (what changes were made on fileN.xls on sheet3 on row 844
    The report could be placed in the same folder as the attribute file.

    Is it even possible to modify external excel files with a macro/excel programming?

    The very first question is still, how to modify the range to cover multiple sheets at once?

    Thanks in advance!

    Kalle

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: A mod needed in Find and Replace -code

    • This loops through all excel files in the folder "C:\Find_replace\Files\"
    • It replaces on all sheets for each file.
    • It does not make a report. The Replace method does not return information of what was changed.


    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    11-27-2017
    Location
    Kokkola, Finland
    MS-Off Ver
    Excel 2016
    Posts
    3

    Re: A mod needed in Find and Replace -code

    Awesome! Thank you so much!

    Btw, you seem like a VBA professional so what do you think, is it a huge operation to modify the code so that it will produce the report?
    Do you know any good threads where I could ask for help to this kind of problem? Maybe there is already some similar codes which could be imported in your code..

    -Kalle

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: A mod needed in Find and Replace -code

    • You're welcome.
    • I'm not a VBA professional.
    • It's not a "huge" operation to modify the code, but it's more than I'm willing to do.
    • Don't have a good reference resource for you.
    • There is a Commercial Services forum for fee if you're interested.
    Last edited by AlphaFrog; 11-28-2017 at 09:48 AM.

+ 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. Find and Replace when needed Code
    By ulothar in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-09-2017, 08:09 PM
  2. Find & Replace Loop Help Needed
    By bryanmarks in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-29-2014, 10:19 AM
  3. [SOLVED] Formula to find and replace where needed
    By maymano in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-07-2013, 02:09 PM
  4. Help Needed with Find and Replace Macro
    By e30325i in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2013, 02:49 PM
  5. VBA Find and replace loop help needed
    By susanbarbour in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2012, 08:43 AM
  6. [SOLVED] FIND and REPLACE characters needed
    By Peter C in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-10-2006, 03:10 PM
  7. FIND and REPLACE characters needed
    By Peter C in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-08-2006, 05:20 PM

Tags for this Thread

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