Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Declaring 2 dimensional arrays
I want to have an array - Item(100,2) where the first column is a string and
the second column is an integer. Is this possible? If so how do I declare the variable. Dan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Declaring 2 dimensional arrays
Declare the array type as Variant. It can hold any data type.
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Dan" wrote in message ... I want to have an array - Item(100,2) where the first column is a string and the second column is an integer. Is this possible? If so how do I declare the variable. Dan |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Declaring 2 dimensional arrays
Thanks, I thought there was a way.
Dan "Chip Pearson" wrote in message ... Declare the array type as Variant. It can hold any data type. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Dan" wrote in message ... I want to have an array - Item(100,2) where the first column is a string and the second column is an integer. Is this possible? If so how do I declare the variable. Dan |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Declaring 2 dimensional arrays
For the particular case you describe, I believe you can also use
Dim Item(100,2) As String I have no view on whether that is "better" than declaring it as a Variant type. Alan Beban Dan wrote: Thanks, I thought there was a way. Dan "Chip Pearson" wrote in message ... Declare the array type as Variant. It can hold any data type. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Dan" wrote in message .. . I want to have an array - Item(100,2) where the first column is a string and the second column is an integer. Is this possible? If so how do I declare the variable. Dan |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Declaring 2 dimensional arrays
For my own education, what would be advantages and disadvantages to using a user-defined type for this kind of situation? Type myitems a as string b as integer End Type Sub test() Dim item(100) as myitems Code: -------------------- End sub where the variable is referenced using item(i).a="somestring" and item(i).b=someinteger -- MrShorty ------------------------------------------------------------------------ MrShorty's Profile: http://www.excelforum.com/member.php...o&userid=22181 View this thread: http://www.excelforum.com/showthread...hreadid=485333 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Conditional IF formula using multi-dimensional arrays | Excel Worksheet Functions | |||
two dimensional arrays | Excel Worksheet Functions | |||
declaring Arrays to use in a Form with few modules | Excel Programming | |||
Declaring arrays | Excel Programming | |||
Declaring Dynamic Multi-dimensional Array | Excel Programming |