+ Reply to Thread
Results 1 to 5 of 5

Adding mulitple spreadsheet data ranges to a column

  1. #1
    Registered User
    Join Date
    03-07-2011
    Location
    Madison, wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    18

    Adding mulitple spreadsheet data ranges to a column

    This is where my code is failing and I know it's the syntax, but I'm not sure what to change. I've searched all over and found various types of syntax, but none seem to work. I'm sure it's likely something simple, but I'm not seeing it. I want it to search for the last used cell in the column, go to the next empty cell in the column, and put the selected range of data into it. I have multiple spreadsheets to search through that will keep adding to it ("i" is cycling through them).


    Please Login or Register  to view this content.

    I get 424 and 1004 errors (depending on how I tweak the line).

    Thank you!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Adding mulitple spreadsheet data ranges to a column

    When you use the WITH method, the commands that connact to that sheet are preceded by a period to indicate a "continuation" of that WITH command. Also, when using the .VALUE = .VALUE methods, the two ranges need to be identical. You can COPY/PASTE where the COPY is one range of cells but the PASTE target is only a single "Starting Point" cell, but the VALUE method to transfer values on in a single command must be identically sized ranges. In the example below I set the size of the target using the RESIZE parameter.

    Please Login or Register  to view this content.
    ...becomes
    Please Login or Register  to view this content.
    I'm not sure what you gain by using the WITH syntax in this instance as you appear to only target that sheet with the one command.

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Adding mulitple spreadsheet data ranges to a column

    Try something like this:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-07-2011
    Location
    Madison, wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Adding mulitple spreadsheet data ranges to a column

    Hmmmm... JBeaucaire, you bring up a good point. I had originally created this for a copy from a range of cells to another on one spreadsheet, but adding the multiples this doesn't work. Basically, I'll have "i" number of spreadsheets. Every spreadsheet will have data starting at column S4 to an unknown point (which is why I had originally put a static range on it knowing it would never be past 2000). I need to copy/paste that data into the "Cutsheets" worksheet and then continue pasting where it left off.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Adding mulitple spreadsheet data ranges to a column

    In that case, I believe the last code suggestion in post #2 would still accomplish that as long as there were never more than 2000 lines to copy at one time. If there might be even more than that, then you can handle that by just grabbing that # of rows specifically.


    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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