+ Reply to Thread
Results 1 to 8 of 8

VBA to copy data from closed workbook to open workbook

  1. #1
    Registered User
    Join Date
    11-27-2008
    Location
    Noida
    Posts
    51

    VBA to copy data from closed workbook to open workbook

    Hi

    I am new to VBA , can it possible that wat i did manually can be automate below are the step which
    i daily do to complete the report for referenve i attch the three files

    Step 1- First i open the file "data.xls" and insert the status coulumn status , in this coulumn i used
    the VLOOKUp TO get the staus value for each clientid fromthe file Mapping

    STEP-2 - After ist step i insert TWO column ( Month , WEEK ) column afte the coulumn Date/Time Stamp
    and get the month & Week (like "WEEK1")

    STEP3 - After above steps open the file report and copy the data from " data.xls" and paste them in report.xls

    Wat i want is that possible without opening the file data.xls the step1 & step2 is perform through automation and copy the data
    in my open workbook report.xls
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-27-2008
    Location
    Noida
    Posts
    51

    Re: VAB to copy data from closed workbook to open workbook

    can any body help me out

  3. #3
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: VBA to copy data from closed workbook to open workbook

    I don't believe there is any way that VBA can retrieve data from a closed workbook.

    It's possible to have a spreadsheet pulling data out of another workbook. When you open the spreadsheet and the other workbook is closed, Excel will ask you if you want to update the data from the closed workbook. If you say "yes" it updates without opening the other workbook.

  4. #4
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    Re: VBA to copy data from closed workbook to open workbook

    Hi
    It is possible to pull data / vlookup from closed workbooks.From your attachments, it is not clear to me which is data.xls, how you get status value, month and week and which part of report they go into.
    Ravi

  5. #5
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Re: VBA to copy data from closed workbook to open workbook


  6. #6
    Registered User
    Join Date
    03-04-2011
    Location
    Almaty, Kazakhstan
    MS-Off Ver
    Excel 2007
    Posts
    3

    VBA to copy data from closed workbooks into an open workbook

    Hello,

    I have 3 workbooks named "AAA.xlsx, BBB.xlsx, CCC.xlsx" and a master workbook named "master.xlsx". They are all stored in one folder in company's network drive. These 3 workbooks contain, among other worksheets, a worksheet named "Datasheet". This worksheet in all 3 workbooks have the same format and headings except for data and number of rows which are dynamic and change depending on users' entries. What I need is a VBA code to copy all cells (values only) from Datasheet of all 3 workbooks into a mastersheet in my master workbook. The headings must not be copied because the mastersheet in my masterworkbook already contains the heading. Another way is to clear the mastersheet and copy the heading only once.

    I would appreciate your help.

    Bakha

  7. #7
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Re: VBA to copy data from closed workbook to open workbook

    insert the following code into a standard code module in the master workbook, then save the master workbook as Master.xlsm. Then run it.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-27-2011
    Location
    Santiago, Dominican Republic
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA to copy data from closed workbook to open workbook

    hello, i'm reading the post and the code does close to what i need, but it keeps giving me "run time-error 9"

    i'll attach the file and please help with the code, I'm a newbie in VBA, so please help

    Thanks
    Attached Files Attached Files

+ 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