PC Review


Reply
Thread Tools Rate Thread

array values

 
 
Striker3070
Guest
Posts: n/a
 
      29th Apr 2010
I have an array with about 1500 names in it. How can I add those names to
column A1 on sheet1 and go down one cell 1500 times and add the next value
to the spreadsheet? in Excel07 VBA

 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      29th Apr 2010
I think this is right. give it a try. Substiture your array name for
myArr. The code below assumes a zero based array, if yours is base 1 then
you will not need the + 1 for the range row designation. This would start in
A1 and continue downward for the number of items in the array.

For i = LBound(myArr) To UBound(myArr)
Range("A" & i + 1) = myArr(i).value
Next





"Striker3070" <(E-Mail Removed)> wrote in message
news:A8A6DCC6-327A-4F56-BFE0-(E-Mail Removed)...
>I have an array with about 1500 names in it. How can I add those names to
>column A1 on sheet1 and go down one cell 1500 times and add the next value
>to the spreadsheet? in Excel07 VBA



 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      30th Apr 2010
Should have tested it first. Use this.

For i = LBound(myArr) To UBound(myArr)
Range("A" & i + 1) = myArr(i)
Next

Adding the .Value will throw an error since myArr(i) is a value.


"Striker3070" <(E-Mail Removed)> wrote in message
news:A8A6DCC6-327A-4F56-BFE0-(E-Mail Removed)...
>I have an array with about 1500 names in it. How can I add those names to
>column A1 on sheet1 and go down one cell 1500 times and add the next value
>to the spreadsheet? in Excel07 VBA



 
Reply With Quote
 
Dana DeLouis
Guest
Posts: n/a
 
      30th Apr 2010
On 4/29/2010 7:05 PM, JLGWhiz wrote:
> Should have tested it first. Use this.
>
> For i = LBound(myArr) To UBound(myArr)
> Range("A"& i + 1) = myArr(i)
> Next
>
> Adding the .Value will throw an error since myArr(i) is a value.
>
>
> "Striker3070"<(E-Mail Removed)> wrote in message
> news:A8A6DCC6-327A-4F56-BFE0-(E-Mail Removed)...
>> I have an array with about 1500 names in it. How can I add those names to
>> column A1 on sheet1 and go down one cell 1500 times and add the next value
>> to the spreadsheet? in Excel07 VBA


> For i = LBound(myArr) To UBound(myArr)


Hi. Not likely, but one could have:

Dim m(-5 To 5)

Just an idea...

n = UBound(v) - LBound(v) + 1

[A1].Resize(n) = v
'or
[B1].Resize(n) = WorksheetFunction.Transpose(v)

= = = = = = =
HTH :>)
Dana DeLouis
 
Reply With Quote
 
Javed
Guest
Posts: n/a
 
      30th Apr 2010
On Apr 30, 9:31*am, Dana DeLouis <delo...@bellsouth.net> wrote:
> On 4/29/2010 7:05 PM, JLGWhiz wrote:
>
> > Should have tested it first. *Use this.

>
> > For i = LBound(myArr) To UBound(myArr)
> > * *Range("A"& *i + 1) = myArr(i)
> > Next

>
> > Adding the .Value will throw an error since myArr(i) is a value.

>
> > "Striker3070"<striker3...@qwest.net> *wrote in message
> >news:A8A6DCC6-327A-4F56-BFE0-(E-Mail Removed)...
> >> I have an array with about 1500 names in it. *How can I add those names to
> >> column A1 on sheet1 and go down one cell 1500 times and add the next value
> >> to the spreadsheet? in Excel07 VBA

>
> *> For i = LBound(myArr) To UBound(myArr)
>
> Hi. *Not likely, but one could have:
>
> Dim m(-5 To 5)
>
> Just an idea...
>
> n = UBound(v) - LBound(v) + 1
>
> [A1].Resize(n) = v
> 'or
> [B1].Resize(n) = WorksheetFunction.Transpose(v)
>
> = = = = = = =
> HTH *:>)
> Dana DeLouis


Use following code:

Range(YourRange).value=worksheetfunction.transpose(MyArr)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Initialise the registry values in a array and retrive the values asrequired Subodh Microsoft Excel Programming 1 26th Apr 2010 05:11 AM
Array: Counting multiple values within array Trilux_nogo Microsoft Excel Worksheet Functions 4 16th Apr 2007 03:12 AM
search an array for values contained in another array =?Utf-8?B?Q2hlZXItUGhpbC1seQ==?= Microsoft Excel Programming 0 12th Apr 2007 09:44 PM
Extracting a 2 dimensional array of values from a range of Excel Values. Greg Microsoft C# .NET 2 25th Nov 2005 03:40 PM
Help finding out if a set of values exists in a larger array of values shadestreet Microsoft Excel Worksheet Functions 2 26th Mar 2004 07:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:40 PM.