+ Reply to Thread
Results 1 to 11 of 11

Specifc Alphanumerics initates a find & replace function

  1. #1
    Forum Contributor
    Join Date
    08-24-2011
    Location
    Van Wert, Ohio
    MS-Off Ver
    Excel 2010, 2000
    Posts
    104

    Specifc Alphanumerics initates a find & replace function

    Cell A1 will have a specific city name e.g. Troy, Celina, Piqua

    If you look through columns C, G, K, O and T you will notice links that all come from the same file. Within the link is the name you will see in A1.

    What I have found that works is a "find & replace".

    All my links update correctly and everything appears ok.

    What I would like to have happen is when I type the specific city in A1, it will automatically do a "find and replace" for whatever city I type in A1,thus updating all my links automatically.

    I realize you might be thinking why not just edit the links to the file you want. The file I attached is small piece to a much larger workbook where the links are involved in numerous other worksheets within the workbook.

    Hope this helps and thank you for your insights
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Specifc Alphanumerics initates a find & replace function

    Untested, but you could try this one.

    c4 =Indirect("'C:\1KFC\Excel\2013\LY Sales\P1012\["&A1&" Numbers P1012.xls]Tracking'!I4")
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Specifc Alphanumerics initates a find & replace function

    Pl see the attached file.
    Worksheet_change event is used.
    Copying range is taken as E2,I2,M2,Q2. Ranges can be specified as per need.
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Specifc Alphanumerics initates a find & replace function

    INDIRECT doesn't work on closed workbooks. If this is a MUST, then you'll have to install more functionality into your Excel program. Only people with the same installed ADD-IN will be able to use your sheet.

    The ADD-IN is called MoreFunc...read all about it here:
    http://www.ashishmathur.com/tag/morefunc/

    See step #4 of that page for instructions on downloading and installing

    Go into TOOLS > ADDINS and activate MoreFunc.

    Now you have many, many new functions available to you. Any place you used INDIRECT, now use INDIRECT.EXT instead and it will work on closed workbooks.

    Now you can try oeldere's formula approach and it should work.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Specifc Alphanumerics initates a find & replace function

    Hi,

    Rather than Find & Replace you could use the Data Edit Links

    i.e.

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  6. #6
    Forum Contributor
    Join Date
    08-24-2011
    Location
    Van Wert, Ohio
    MS-Off Ver
    Excel 2010, 2000
    Posts
    104

    Re: Specifc Alphanumerics initates a find & replace function

    JBeaucaire this most likely would not be practical because many other people use the workbook, but thanks anyway

    Mr. Buttrey

    How would I incorporate this into my worksheet?
    Thanks

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Specifc Alphanumerics initates a find & replace function

    Hi,

    Put the code in a Module level Procedure and then decide which event you want to trigger the change. This could be a change to either cell A1 or perhaps a button on the sheet which when clicked runs the macro. The procedure would be - changed from previously

    Please Login or Register  to view this content.
    Note. It assumes the workbook that has the links is in the same folder as the linked files and that there is only one link to change. If there are more than one then this will need changing.

    With a button just right click the button and choose Assign Macro and pick the 'ChangeLinkedFile' procedure above.
    If you want to trigger it when A1 is changed use the SheetChange event

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    08-24-2011
    Location
    Van Wert, Ohio
    MS-Off Ver
    Excel 2010, 2000
    Posts
    104

    Re: Specifc Alphanumerics initates a find & replace function

    Mr Buttrey

    I am having difficulty with your suggestions. I have decided to zip and attach the whole file for you to hopefully it will help.

    The tab with the issue at hand is TYLY Tracking. As you will see starting in column C the linked files. If you go to edit the links you will see 7 links. The links with the Capital letters, T,P,U,G, and C are the ones to be interchangeable with this spreadsheet. However, those links are used in other worksheets within this workbook.

    Currently in the TYLY Tracking spreadsheet the link is for the Celina file. If i edit the links and "change source" to another store file it will change ALL the links for that file in the entire workbook. I need to be able to just change the links for a spreadsheet, but it does not give me that option.

    This is why find and replace works

    Find: Celina

    ='H:\1KFC\Excel\2013\LY Sales\P1012\[CELINA Numbers P1012.xls]Tracking'!I5

    Replace with: Greenville

    ='H:\1KFC\Excel\2013\LY Sales\P1012\[GREENVILLE Numbers P1012.xls]Tracking'!I6

    Thats why ideally I wanted A1 = the store name and everything else in the sheet would take care of itself depending on the name given in A1

    I was able to create a command button that would do a find and replace function, but I think I would need to create 4 command buttons to get through all my stores.

    What happens is this file ""Store" Numbers 1013" becomes "Troy Numbers 1013', "Piqua Numbers 1013" and so on.

    I hope this helps and I really apprecraite you help with this.

    Thanks
    Attached Files Attached Files

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Specifc Alphanumerics initates a find & replace function

    Hi,

    Your original post suggested that you were wanting to change all links throughout the workbook whereas I now understand that you want to selectively change links on specific sheets.
    Sadly you can't do that with the Edit links functionality. It's all or nothing. And as Jerry has remarked INDIRECT() doesn't work on closed workbooks.

    Without resorting to external add on tools or software it seems that the best way forward would be to change your formulae to incorporate INDIRECT functions and then get your macro to open up the workbooks that are linked to the sheets in question and immediately close them thus effectively changing the link.

  10. #10
    Forum Contributor
    Join Date
    08-24-2011
    Location
    Van Wert, Ohio
    MS-Off Ver
    Excel 2010, 2000
    Posts
    104

    Re: Specifc Alphanumerics initates a find & replace function

    Thanks Rickard

    Everything has its limitations.

    Regards

  11. #11
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Specifc Alphanumerics initates a find & replace function

    Just a further point of clarification.

    You said you have several different links.

    If a link doesn't relate to more than one sheet then you can of course use Edit Links as I suggested - you'd have to work out the index number of the link and include that in the code I gave you. It's only if a link exists on two or more sheets and you only want to update one sheet that you couldn't use Edit Links.

    And just a further idea. With the same link on two or more sheets, only one of which you want to change, you could I suppose temporarily change the links on the other worksheet by say temporarily adding some characters to the workbook name, or changing the formula to text by adding a text label marker with a Find/Replace, then do the Edit Links thus only affecting the one sheet, then reverse the changes you've just made.

+ 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. Replace & Find function
    By eaflynn in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-22-2013, 08:04 PM
  2. Replies: 3
    Last Post: 12-18-2012, 07:19 PM
  3. [SOLVED] Find in column and then move results to specifc sheet
    By cheezehead in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-09-2012, 05:42 PM
  4. Replies: 1
    Last Post: 07-25-2012, 07:44 AM
  5. [SOLVED] Excel: Be able to mark specifc items in the find/replace mode & a.
    By MJLOVESMICROSOFT in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-22-2005, 07: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