+ Reply to Thread
Results 1 to 8 of 8

Code to Import Data from a Closed Workbook

  1. #1
    Forum Contributor
    Join Date
    06-25-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016
    Posts
    615

    Code to Import Data from a Closed Workbook

    Hi Folks

    I want to import the entire data from selected sheets in other Workbooks to a main Workbook (MAIN VIEWER) as per the attached samples.

    Kind regards
    hammer
    Attached Files Attached Files
    If you have found solving my problem/s to be an interesting and educational exercise then how about Repping me up?
    No idea why I need Rep, other than feeling left out....

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Code to Import Data from a Closed Workbook

    Hi, I havne't looked at the files yet but the first thing that comes to mind is that a csv file has no multiple sheets so what's the problem?
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Contributor
    Join Date
    06-25-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016
    Posts
    615

    Re: Code to Import Data from a Closed Workbook

    Hi Keebellah ... then that part won't be a problem thanks.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Code to Import Data from a Closed Workbook

    File name in A2 is not correct.
    Assuming csv file and workbook are in the same folder.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-25-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016
    Posts
    615

    Re: Code to Import Data from a Closed Workbook

    Hi Jindon
    That works perfectly! Thanks so much for your time.
    Regards
    hammer

  6. #6
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Re: Code to Import Data from a Closed Workbook

    Hi Jindon Sir,

    in above case
    one thing i would like to ask you that how can we get the rs rows count?
    means
    Please Login or Register  to view this content.
    but how can we get rs rows count e.g. in this case 20 is the count.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Code to Import Data from a Closed Workbook

    1) add 1 line
    Please Login or Register  to view this content.
    then
    Please Login or Register  to view this content.
    This excludes header row in this case, because of the setting "HDR=Yes"

  8. #8
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Re: Code to Import Data from a Closed Workbook

    Hi Jindon Sir,

    Thank you very much

+ 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. Import data from closed workbook
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-18-2015, 09:02 AM
  2. Replies: 0
    Last Post: 03-27-2014, 12:38 PM
  3. [SOLVED] Code to copy data from a closed workbook and paste in active workbook using named range.
    By paullie1912 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-28-2014, 02:38 AM
  4. 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
  5. 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
  6. 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
  7. 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