+ Reply to Thread
Results 1 to 4 of 4

VBA - problem copying data from storage array to sheet array

  1. #1
    Registered User
    Join Date
    08-11-2020
    Location
    Uk
    MS-Off Ver
    365
    Posts
    2

    VBA - problem copying data from storage array to sheet array

    I am trying to replicate what a Data Table does in excel in VBA. I have got the code working as I want thus far however when I copy data out of the temporary storage array it is offset by 1 Column and 1 Row.

    I cannot figure out what the issue is? Thanks in advance.
    Please Login or Register  to view this content.

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,645

    Re: VBA - problem copying data from storage array to sheet array

    Hi there,

    It's late here, so I'm not claiming to have thought this one through fully, but what goes through my mind is that the statement:

    Please Login or Register  to view this content.
    creates a zero-based array,

    while the statement:
    Please Login or Register  to view this content.
    creates a one-based array.

    This might account for your "one row off, one column off" situation.


    Hope this helps.

    Regards,

    Greg M



    P. S. To make the two arrays consistent you can use:

    Please Login or Register  to view this content.
    Last edited by Greg M; 08-11-2020 at 08:29 PM. Reason: P. S. added

  3. #3
    Registered User
    Join Date
    08-11-2020
    Location
    Uk
    MS-Off Ver
    365
    Posts
    2

    Re: VBA - problem copying data from storage array to sheet array

    That worked perfectly! Thank you!

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,645

    Re: VBA - problem copying data from storage array to sheet array

    Hi again,

    Many thanks for your feedback.

    You're welcome - glad I was able to help.

    Regards,

    Greg M

+ 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. [SOLVED] Filter Array 1 with Array 2 as criteria, returning filtered data to source sheet
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-31-2019, 01:08 PM
  2. [SOLVED] Copying an array formula down keeps copying data in top row
    By blackrosepetals9169 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-10-2018, 05:15 AM
  3. Replies: 1
    Last Post: 09-01-2014, 05:27 PM
  4. Array Storage Problem: Array Elements Deleted on 'End' Command
    By AidenS in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-15-2014, 10:38 AM
  5. Problem copying array values to worksheet cells
    By CoolGal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2008, 02:00 AM
  6. Array problem: Key words-Variant Array, single-element, type mismatch error
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-09-2005, 01:54 AM
  7. Array problem: Key words-Variant Array, single-element, type mismatch error
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2005, 12:30 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