+ Reply to Thread
Results 1 to 8 of 8

pasting array from VBA into worksheet

  1. #1
    Registered User
    Join Date
    07-25-2008
    Location
    Tucson, AZ
    Posts
    90

    pasting array from VBA into worksheet

    Please Login or Register  to view this content.
    paste_range.count = 262
    ubound(copy_array) = 262

    so they should have the same count

    but when I perform the paste operation, it pastes the first entry of copy_array into every cell of paste_range

    why isn't it pasting each unique value into the worksheet range?

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: pasting array from VBA into worksheet

    Because you need to transpose the array. Why not simply assign one range to the other though:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    07-25-2008
    Location
    Tucson, AZ
    Posts
    90

    Re: pasting array from VBA into worksheet

    Please Login or Register  to view this content.
    gives me an "Invalid Qualifier" error

    copy_array is a (1 to 262) Variant array

    why and how would I transpose copy_array?

    Please Login or Register  to view this content.
    seems to give me gibberish #'s
    Last edited by twd000; 06-09-2010 at 05:19 PM.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: pasting array from VBA into worksheet

    I didn't say anything about copy_array.value though?

  5. #5
    Registered User
    Join Date
    07-25-2008
    Location
    Tucson, AZ
    Posts
    90

    Re: pasting array from VBA into worksheet

    I can't paste directly from copy_range to paste_range because copy_range is non-contiguous

    I fill copy_array with the contents of copy_range and now I'm trying to paste that array into the worksheet

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: pasting array from VBA into worksheet

    In that case make copy_array a 2D array but have the second dimension only one column. You can then paste to the target range directly.

  7. #7
    Registered User
    Join Date
    07-25-2008
    Location
    Tucson, AZ
    Posts
    90

    Re: pasting array from VBA into worksheet

    so copy_array would be listed as Variant(1 to 262, 1 to 1) ?

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: pasting array from VBA into worksheet

    Well,
    Please Login or Register  to view this content.
    to be exact.

+ 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