+ Reply to Thread
Results 1 to 4 of 4

Import data from closed workbook

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Import data from closed workbook

    Hello:

    Please refer to attached sample files.
    I have attached Master file and 2 data file.
    In master file Sheet1 (open file), i will be choosing the file name (closed file) to export the data to sheet2 of Master file.
    Below is what i need the VB Code for:
    Will have weekly data file in C:\Test2\ directory and name of the file would be in cell Shee1 of Master file Cell A2.
    I need the data from Book1, Sheet1 data in column AM,AN and AJ to be pasted in the next available row in Sheet2 of Master file in
    column A,B and E.

    Let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Import data from closed workbook

    Try this,
    Make sure your file names match as they don't with the samples you attached.
    Please Login or Register  to view this content.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Import data from closed workbook

    My previous post does not register as being here.

  4. #4
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Import data from closed workbook

    Hi Daveexcel:

    Works great without any problem.
    However, I like to have your help in little tweaking.
    1.
    First if the file name in cell A2, does not exist then popup message saying "File does not exist..Continue to exist"

    2.
    I want to overwrite if the particular data already exist in Sheet2 of Master file.
    I think it would be sufficient to check the first date of the source file and if that date exist in sheet2 of Master file then overwrite the whole data of the source at that position in Sheet2 of Master. The other option would be to see if the same 1st date is in Master (Sheet2), if it does then look for 1st date + 6 end of week date and clear that block before pasting.
    For Example:
    1st date in Source file is 1/11/2015
    Look for 1/11/2015 in column A of Sheet2 Master file.
    If it finds 1/11/2015 then clear the cell content until 1/18/2015 (which is 1/11/2015+6).

    Please let me know if you have any questions.
    Once again thanks a lot for all the expert help.

    Riz
    Last edited by rizmomin; 01-18-2015 at 12:52 PM.

+ 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. Replies: 0
    Last Post: 03-27-2014, 12:38 PM
  2. Import data from several closed workbooks to a single sheet in an open workbook
    By drewship in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2013, 06:35 AM
  3. Macro to Import Data from Closed Workbook to CSV File
    By groundin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2013, 09:39 PM
  4. code to import data from a closed workbook
    By jeepguy8794 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-27-2011, 05:44 PM
  5. Replies: 1
    Last Post: 11-26-2011, 09:10 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