Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() i'm having a problem with one of my classes. i have 2 methods in my class(among others): Code: -------------------- Property Let IngredientName(Index As Integer, sName As String) If rgSandwich Is Nothing Then IngredientName = "" Else rgSandwich.Offset(0, Index + 2).Value = sName End If End Property Property Get IngredientName(Index As Integer) As String If rgSandwich Is Nothing Then UninitializedError Else IngredientName = rgSandwich.Offset(0, Index + 2).Value End If End Property -------------------- and a macro in a module: Code: -------------------- Sub Testing() Dim oSandwich As Sandwich Dim oSandwiches As New Sandwiches Set oSandwich = oSandwiches.Add("Testing Sandwich") With oSandwich .Name = "Testing Sandwich" .Size = "Yeah" ' (see below) End With End Sub -------------------- i want to be able to have something like .IngredientName(1) = "Tomatoes" or .IngredientName(3) = "Sauce" where the "(see below)" comment is, but i'm not sure on how to structure my properties in order to do so. does anyone know how i can do this? thanks ahead of time, sven -- medicenpringles ------------------------------------------------------------------------ medicenpringles's Profile: http://www.excelforum.com/member.php...o&userid=16458 View this thread: http://www.excelforum.com/showthread...hreadid=477929 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
aauugghhh...#div/o problems & various average formula problems | Excel Worksheet Functions | |||
Problems Setting properties of class module | Excel Programming | |||
Excell VBA - Class Modules problems | Excel Programming | |||
Collection Class problems | Excel Programming | |||
RaiseEvent from a class contained in a 2nd class collection? | Excel Programming |