Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Multi-level User Definet Types

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multi-level User Definet Types

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
multi-level indexing? 44judester Excel Worksheet Functions 5 August 6th 09 03:13 PM
Costed Multi Level BOM RobN via OfficeKB.com Excel Discussion (Misc queries) 1 August 4th 08 06:40 PM
multi level worksheets Lesley Excel Discussion (Misc queries) 1 September 12th 06 04:53 AM
Using macro to convert single level BOM to Multi Level BOM andrew_chong Excel Programming 0 February 7th 06 08:57 PM
Multi-level passwords Todor Excel Discussion (Misc queries) 7 June 7th 05 06:36 PM


All times are GMT +1. The time now is 10:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"