LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default How to copy VBA array into range of cells?

What is the syntax for copying a VBA array into a range of cells?

I know I can copy into each cell individually in a for-loop. I am
wondering if there is a way to do it en masse in a single statement.

For example:

dim xdata(10) as variant
for i = 1 to 10: xdata(i-1) = i: next i
range("a1:a10") = xdata

That does not work the way that I want. It copies xdata(0) into each
of A1:A10 instead of copying xdata(1) into A2, xdata(2) into A3, etc.
I want the latter.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy a range into an array Robert[_32_] Excel Programming 3 July 10th 08 03:23 PM
copy one array formula to an array range guedj54 Excel Programming 2 October 29th 06 07:38 PM
efficiently copy values from a Range of cells to an array (in VB.N JW Excel Programming 0 June 22nd 04 11:17 AM
efficiently copy values from a Range of cells to an array (in VB.N JW Excel Programming 0 June 22nd 04 11:15 AM
How Can I copy all value of the array into the range? sjoo Excel Programming 0 August 8th 03 07:30 AM


All times are GMT +1. The time now is 12:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"