+ Reply to Thread
Results 1 to 9 of 9

Update formula based on cell selection

  1. #1
    Registered User
    Join Date
    07-01-2010
    Location
    Southampton, UK
    MS-Off Ver
    Excel 2003
    Posts
    9

    Update formula based on cell selection

    Hi All,

    firstly, apologies if this has already been asked but each time I try to search, I get a web error

    I have a data validation in cell A2 which contains a list of people initials. In cells A4:IM12 I have a formula linking to an existing workbook on my network. Each member contained in A2 has their own workbook called [Initials] Task Planner.xls

    What I am trying to do is each time a name is selected in A2 is for the formulae in A4:IM12 to automatically update so that the cells point to the correct workbook.

    Any suggestions on how to do this please as it has me completely stumped.

    Cheers in advance!

    Mav
    Last edited by Maver1ck666; 07-01-2010 at 09:49 AM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,972

    Re: Update formula based on cell selection

    The easiest way would probably be to effectively automate the Edit Links function. Do you have any other links to external files in the workbook?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    07-01-2010
    Location
    Southampton, UK
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Update formula based on cell selection

    Unfortunately, I do have links to other documents that need to remain static.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,972

    Re: Update formula based on cell selection

    Then you'll need to store the last Initials value, either in a cell or in a named range. You can then use a Worksheet_Change event to compare the new value of the cell with the last set of initials chosen, and update the links if required. Something like this:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-01-2010
    Location
    Southampton, UK
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Update formula based on cell selection

    Cheers for that mate.

    I have the persons initials appearing in cell A3 once the name has been selected from A2.

    I have looked through your code but cant quite figure out where to amend it to pick up the new initials. Seem to be having one of those days!

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,972

    Re: Update formula based on cell selection

    Change this line:
    Please Login or Register  to view this content.
    to use A3 instead.

  7. #7
    Registered User
    Join Date
    07-01-2010
    Location
    Southampton, UK
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Update formula based on cell selection

    Thats what I had done but when it comes to the next line

    Please Login or Register  to view this content.
    Im getting a type mismatch

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,972

    Re: Update formula based on cell selection

    I forgot to mention that you need to define a name called LastInitials and assign it the value of the initials currently in use by your formula.

  9. #9
    Registered User
    Join Date
    07-01-2010
    Location
    Southampton, UK
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Update formula based on cell selection

    Excellent, cheers mate, got it working :D Only takes 25 seconds to update lol but I guess its due to the fact is has to update 2205 links.

    Thanks again!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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