Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can you create a UDT with multiple levels of depth?
For example, if I had user defined type called house with the sublevels shown below, would I be able to dim House1 as house and have a multi-layered UDT so that I could call values like this House.MasterBedroom.Height or House.DiningRoom.Breadth? I'm not sure if this explains what I'm asking, but it's the best example I can think of. Below is the structure for the UDT that I am imagining. Is it possible to have a UDT that is more than one layer deep, with elements and sub-elements? House -MasterBedroom ---Breadth ---Depth ---Height ---Flooring ---PaintColour -Guestroom ---Breadth ---Depth ---Height ---Flooring ---PaintColour -LivingRoom ---Breadth ---Depth ---Height ---Flooring ---PaintColour -DiningRoom ---Breadth ---Depth ---Height ---Flooring ---PaintColour -Bathroom ---Breadth ---Depth ---Height ---Flooring ---PaintColour |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You would use two UDTs... one for the room type and another for the
properties; then you would declare the individual room types to be of the properties type. Here is an example... Private Type Properties Breadth As Double Depth As Double Height As Double Flooring As Long PaintColour As Long End Type Private Type Rooms MasterBedroom As Properties Guestroom As Properties LivingRoom As Properties DiningRoom As Properties Bathroom As Properties End Type You can now declare a variable to be of type Rooms and it will automatically possess the properties. For example, Dim MyRooms As Rooms MyRooms.Livingroom.Height = 8.25 Rick "steve" wrote in message ... Can you create a UDT with multiple levels of depth? For example, if I had user defined type called house with the sublevels shown below, would I be able to dim House1 as house and have a multi-layered UDT so that I could call values like this House.MasterBedroom.Height or House.DiningRoom.Breadth? I'm not sure if this explains what I'm asking, but it's the best example I can think of. Below is the structure for the UDT that I am imagining. Is it possible to have a UDT that is more than one layer deep, with elements and sub-elements? House -MasterBedroom ---Breadth ---Depth ---Height ---Flooring ---PaintColour -Guestroom ---Breadth ---Depth ---Height ---Flooring ---PaintColour -LivingRoom ---Breadth ---Depth ---Height ---Flooring ---PaintColour -DiningRoom ---Breadth ---Depth ---Height ---Flooring ---PaintColour -Bathroom ---Breadth ---Depth ---Height ---Flooring ---PaintColour |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
multi-level indexing? | Excel Worksheet Functions | |||
Costed Multi Level BOM | Excel Discussion (Misc queries) | |||
multi level worksheets | Excel Discussion (Misc queries) | |||
Using macro to convert single level BOM to Multi Level BOM | Excel Programming | |||
Multi-level passwords | Excel Discussion (Misc queries) |