Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Named range in an array
Hi,
I have five cells on a row (A1:A5). This range is named "xyz". How can I transform this range in an array with VB code? Thank you. Paolo. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Named range in an array
dim v as Variant
v = Range("xyz").Value for i = 1 to 5 msgbox v(i,1) Next If you want a 1D array v = application.Transpose("xyz") for i = 1 to 5 msgbox v(i) Next -- Regards, Tom Ogilvy "Frigster" wrote: Hi, I have five cells on a row (A1:A5). This range is named "xyz". How can I transform this range in an array with VB code? Thank you. Paolo. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Named range in an array
Tom Ogilvy wrote:
dim v as Variant v = Range("xyz").Value for i = 1 to 5 msgbox v(i,1) Next If you want a 1D array v = application.Transpose("xyz")'<---A typo:v = application.Transpose(Range("xyz")) for i = 1 to 5 msgbox v(i) Next Alan Beban |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Named range in an array
Sorry, I think there is again a typo ...
If you want a 1D array v = application.WorkSheetFunction.Transpose(Range("xyz ")) Christian CROCHE |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Named range in an array
No, there is no requirement to use WorksheetFunction. No typo.
-- Regards, Tom Ogilvy "ccroche" wrote in message ... Sorry, I think there is again a typo ... If you want a 1D array v = application.WorkSheetFunction.Transpose(Range("xyz ")) Christian CROCHE |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Named range in an array
One way:
Dim arr As Variant arr = Range("A1:A5").Value In article , "Frigster" wrote: Hi, I have five cells on a row (A1:A5). This range is named "xyz". How can I transform this range in an array with VB code? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using Named Range within an Array Formula | Excel Discussion (Misc queries) | |||
Array as a "named range" - formula ok in cells, but error as "named range" | Excel Discussion (Misc queries) | |||
Named range into an array | Excel Worksheet Functions | |||
Array to named range conversion... | Excel Discussion (Misc queries) | |||
Defined named range to array | Excel Programming |