+ Reply to Thread
Results 1 to 6 of 6

extract a range into VB from another workbook

  1. #1
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    extract a range into VB from another workbook

    Trying to load a range into VB from another workbook, but getting an error:

    Please Login or Register  to view this content.
    Thanks
    You either quit or become really good at it. There are no other choices.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,503

    Re: extract a range into VB from another workbook

    If ABCDE is meant to be a text string, it's not, it's an undefined variable and hence it is empty/null. Put it in double quotes ... "ABCDE".
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: extract a range into VB from another workbook

    Ooops.... In the original code it is a string. My mistake, sorry. I just forgot to put it in quotes here.

    I got it to work finally, but with a rather long line. Is this the only way that this can be done using "Cells(...." Seems like there should be a shorter method. Trying to avoid using Range("A3:T62") format where I have to refer to columns by letters instead of numbers.
    Please Login or Register  to view this content.
    Last edited by luv2glyd; 04-17-2016 at 09:49 AM.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,503

    Re: extract a range into VB from another workbook

    Maybe this (untested):

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: extract a range into VB from another workbook

    Ok, that will work quite a bit better. Thanks!

    PS: for anyone looking at this in the future - did some testing and realize I can just do this:

    Please Login or Register  to view this content.
    Last edited by luv2glyd; 04-23-2016 at 12:00 AM.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,503

    Re: extract a range into VB from another workbook

    Not quite sure why I wrote it like that . Using "With" means I can write:

    Please Login or Register  to view this content.
    And thanks for the rep

+ 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. extract cell data from one workbook to master workbook
    By mikey141 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-19-2015, 11:05 PM
  2. EXCEL VBA Search Range, Extract to different workbook
    By tsamuels in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-21-2015, 10:48 AM
  3. Replies: 1
    Last Post: 01-19-2015, 02:05 PM
  4. Extract all data to new workbook then filter and extract to new worksheets
    By graphicgoose in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-04-2014, 08:18 PM
  5. Copy from Extract in one workbook to specific cell range in other
    By Michelle Deigh in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-20-2013, 09:07 AM
  6. [SOLVED] Extract data from one workbook and populate a separate workbook
    By gobeavers in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-10-2012, 05:45 PM
  7. [SOLVED] Extract specific range values on an active workbook
    By Surya51 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-27-2012, 11:55 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