Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet arrays in VBA
Hi,
I have created an array named by A in a workbook, say: A={4;3;5;4;8;8;6}. Now, how i can manipulate with this array in VBA environment? For example to grab a value from A within a macro |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet arrays in VBA
On Tue, 28 Jul 2009 13:12:31 -0700 (PDT), Eero
wrote: Hi, I have created an array named by A in a workbook, say: A={4;3;5;4;8;8;6}. Now, how i can manipulate with this array in VBA environment? For example to grab a value from A within a macro Try this: Sub Eero() third_element_of_A = Range("A")(3) MsgBox third_element_of_A End Sub With your example data you should get a message box with 5 when you run this macro. Howeve, I would choose another name of the named range than "A" as that can easily be confused with column A. Hope this helps / Lars-Åke |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet arrays in VBA
On 28 juuli, 23:36, Lars-Åke Aspelin
wrote: Hi, Lars! Thanks for responding. Actually the name A refers to no range but this is a constant array. On Tue, 28 Jul 2009 13:12:31 -0700 (PDT), Eero wrote: Hi, I have created an array named by A in a workbook, say: A={4;3;5;4;8;8;6}. Now, how i can manipulate with this array in VBA environment? For example to grab a value from A within a macro Try this: Sub Eero() * third_element_of_A = Range("A")(3) * MsgBox third_element_of_A End Sub With your example data you should get a message box with 5 when you run this macro. Howeve, I would choose another name of the named range than "A" as that can easily be confused with column A. Hope this helps / Lars-Åke |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding 2 arrays, then use in worksheet function | Excel Programming | |||
Worksheet arrays VBA | Excel Programming | |||
Linking arrays and Worksheet names | Excel Worksheet Functions | |||
Worksheet names to variant arrays | Excel Programming |