+ Reply to Thread
Results 1 to 4 of 4

Open 2 related workbooks in a loop.

  1. #1
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Victoria, Australia
    MS-Off Ver
    365l
    Posts
    170

    Open 2 related workbooks in a loop.

    Folder A has Files - 1501 Melb.xls, 1501 Sydn.xls, 1502 Melb.xls etc.
    Folder B has Files - 1501 Melb1.xls, 1501 Sydn1.xls, 1502. Melb1.xls etc

    I want to loop through the files in Folder A and copy some data to the corresponding file in Folder B (I have code for this)

    I can capture the file name of the current file in folder A, but haven't been able to find any code which would allow me to add the "1" when I open the workbook in folder B

    Any help appreciated.

    I apologise for Asking and running, but have an appointment which will keep me away from the computer for about 3 hours. Will respond as soon as I get back.

    Steve

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Open 2 related workbooks in a loop.

    not quite sure what you mean by current file

    but if your working with xls files
    then
    Please Login or Register  to view this content.
    its minus 4 because
    .xls = 4
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Victoria, Australia
    MS-Off Ver
    365l
    Posts
    170

    Re: Open 2 related workbooks in a loop.

    Thanks Humdingaling. Current file will be the file the loop has opened in folder A - I'm still working on that - simulated here by sub Startsit.

    I changed "fullname" to "name" as it's a different path and the following works and allows me to activate either file at will.

    Thanks again,

    steve

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Open 2 related workbooks in a loop.

    thanks for the rep

    wasnt exactly sure which way you were heading but glad you sorted it out

+ 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. Loop Through Open Xcel Workbooks
    By pablowilks in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2013, 03:19 PM
  2. [SOLVED] Loop to open all workbooks in folder and append data to single sheet
    By beng404 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2013, 01:45 PM
  3. Open workbooks with variables in filename using loop
    By as1234 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-31-2011, 01:17 PM
  4. when i open a excel doc , it open muiltple page not related?
    By greyshark001 in forum Excel General
    Replies: 1
    Last Post: 10-18-2005, 01:05 PM
  5. Related Data Between 2 Different Workbooks
    By freeecoom in forum Excel General
    Replies: 2
    Last Post: 09-24-2005, 02:35 AM
  6. [SOLVED] Loop through, open, and modify all workbooks in file
    By Jason in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-28-2005, 05:05 PM
  7. Loop Through All Open Workbooks
    By scott in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-31-2005, 11: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