+ Reply to Thread
Results 1 to 3 of 3

Copy data from an open workbook with a variable name

  1. #1
    Registered User
    Join Date
    01-11-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    96

    Copy data from an open workbook with a variable name

    Hi Guys

    I am trying to create a sheet that copies staffs efficiency data from a monthly file into a separate sheet to work out their overall efficiency for the year. The problem is that the efficiency file is named for the month and year so I am struggling with code to select to summary sheet on the efficiency file. I have attached examples and there is some code in the PDR efficiency file that sometimes works but the next time I run it, it stops for no reason I can see. The code will have to be run each time you open the next efficiency file to copy the next month so there will be 12 sheets, 1 for each month. Thanks for looking, always appreciated

    Cheers
    Attached Files Attached Files
    Cheers

    Ross

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Copy data from an open workbook with a variable name

    Here is my take on it.

    Run things from the control panel.

    Create a data directory and put the full path to it in Cell H1. Verify the pattern to look for in Cell H2.

    The Get Files button gets the list of files in the data directory. The latest of these files is computed in cell B1.

    Then click on the Copy Summary button. This will copy the status sheet to the end of the workbook and rename it.

    There are custom modules for Get Files and Copy Summary. The ClearTable module is from my "workbench" - give it a point to a sheet and a table name on that sheet. I "dummied up" a couple of files to test it out. and it will clear the data. I've been using it for about a decade.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    01-11-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: Copy data from an open workbook with a variable name

    Thanks dflak. I will have a look as soon as i get time. Greatly appreciated

+ 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. [SOLVED] Open Workbooks with Variable name (Date) and take specific data based on the workbook
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-24-2014, 08:25 PM
  2. Replies: 3
    Last Post: 08-07-2013, 10:16 AM
  3. Replies: 6
    Last Post: 01-29-2013, 07:01 AM
  4. How to copy values from one OPEN workbook (with variable file name) to another
    By Kitko in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-25-2013, 01:50 PM
  5. [SOLVED] Macro to copy data from open workbook to next open line of new workbook
    By nhtodd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2012, 09:42 PM
  6. [SOLVED] Open Workbook, hidden, get cell data into a variable
    By Bruce Tjosvold in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2012, 04:27 PM
  7. Macro to copy data from other workbook - let user choose which open workbook
    By ssu95bm in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-12-2011, 11:17 AM

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