+ Reply to Thread
Results 1 to 3 of 3

Update txt connection based on a cell value

  1. #1
    Forum Contributor
    Join Date
    07-16-2009
    Location
    NA
    MS-Off Ver
    MS Excel 2010
    Posts
    237

    Update txt connection based on a cell value

    Hi all,

    I'm wondering if this could work through vba. I have a workbook of 58 sheets. All the sheets except the first two contain two connections to .txt files. The range is the same in all the sheets. First has the range of T:W and the second Y:AC.
    Upon opening the workbook, I would like to update all links if a certain cell C3 contains "Da". If it contains anything else except "Da" then do not update the connections and delete the data in T:W and Y:AC but leave the connection intact.
    I've attached an example of how the data looks.

    Thanks for your time,
    Alex
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: Update txt connection based on a cell value

    In the Workbook_Open() event use the following:
    Please Login or Register  to view this content.
    I've reattached your book with the code.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    07-16-2009
    Location
    NA
    MS-Off Ver
    MS Excel 2010
    Posts
    237

    Re: Update txt connection based on a cell value

    Works well be there are two problems:
    1. it will need to run on all sheets except the first two
    2. when it doesn't contain "da", the data that is included in the sheet (t:w and y:ac) should be deleted. If it could be done of course without breaking the connection itself.

+ 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