+ Reply to Thread
Results 1 to 4 of 4

Reading out Variant Array to an inactive worksheet

  1. #1
    Forum Contributor
    Join Date
    05-26-2004
    Location
    Halifax, UK
    MS-Off Ver
    Office 2016
    Posts
    260

    Reading out Variant Array to an inactive worksheet

    Can't get this to work if I use Cell keyword rather than Range.

    Please Login or Register  to view this content.
    The code is executed whilst another worksheet is active (not the EventHistory one).


    There's a problem with the line .Range(Cells(2, 1)) = arrVariant(1, i). If I try using the alternative cell reference notation:

    Please Login or Register  to view this content.
    This works but I need to start changing the row,col refs for Cell so can't use the "A2" notation. I've tried moving the . around to before/after the Range keyword, before after the Cell keyword etc but I always get:

    Run-time error '1004': Application-defined or object-defined error.

    Any ideas?

    Cheers
    -Rob
    Last edited by TheRobsterUK; 01-11-2015 at 02:27 PM.

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Reading out Variant Array to an inactive worksheet

    Hi,

    Just use cells() syntax like this :

    Please Login or Register  to view this content.
    -------------
    Edit :
    According to your case, if you want to fill A2:Axxx with arrVariant, it could be something like this :

    Please Login or Register  to view this content.
    Regards
    Last edited by karedog; 01-11-2015 at 11:50 AM.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Forum Contributor
    Join Date
    05-26-2004
    Location
    Halifax, UK
    MS-Off Ver
    Office 2016
    Posts
    260

    Re: Reading out Variant Array to an inactive worksheet

    Got it, thanks. :-)

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Reading out Variant Array to an inactive worksheet

    You are welcome.

    Regards

+ 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. Does setting a variant acting as an array equal to "" accomplish same as "Erase" variant?
    By dmasters4919 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2014, 05:59 PM
  2. [SOLVED] ReDim Variant array for worksheet copy
    By John Keith in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2006, 05:55 PM
  3. 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
  4. 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
  5. [SOLVED] Copying a Variant Array to a worksheet
    By John Keith in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-03-2005, 06:35 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