+ Reply to Thread
Results 1 to 3 of 3

Macro to open files based on string variable

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Macro to open files based on string variable

    Hi all!

    Another saga in my macro development. If someone could please advise how to do (if possible!) the requested would be much appreciated.

    Basically I have a workbook with some titles in a row, say AAA BBB CCC DDD etc.

    Each of these titles represents a workbook to open in the same directory (i.e. AAA is the title of one workbook, BBB the title of the next etc.)

    I am drafting a macro but a bit stuck on how to tell Excel to use the string variable stored in a single dimension array (the workbook row with the titles contained within) as the last part of the filename directory e.g.:

    C:\My documents\AAA
    C:\My documents\BBB
    C:\My documents\CCC


    My macro as it stands:
    Please Login or Register  to view this content.
    If anyone can help would be much appreciated!

    All the best,

    Coeus.
    Last edited by JosephP; 02-11-2013 at 06:39 PM. Reason: Add code tags

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Macro to open files based on string variable

    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,794

    Re: Macro to open files based on string variable

    You could try something like:

    Please Login or Register  to view this content.
    Where you have stored the strings in cell B2 to B5

    C:\My documents\AAA\
    C:\My documents\BBB\
    C:\My documents\CCC\
    C:\My documents\DDD\

    Alf

    Ps When you post code don't forget to wrap it!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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