Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
array values
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
array values
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" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
array values
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" wrote in message ... 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
array values
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. wrote in message ... 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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
array values
On Apr 30, 9:31*am, Dana DeLouis 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. *wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Initialise the registry values in a array and retrive the values asrequired | Excel Programming | |||
Array: Counting multiple values within array | Excel Worksheet Functions | |||
search an array for values contained in another array | Excel Programming | |||
Use array to return array of values | Excel Worksheet Functions | |||
Convert values in a variant array to integer values | Excel Programming |