View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
medicenpringles[_17_] medicenpringles[_17_] is offline
external usenet poster
 
Posts: 1
Default problems with my class


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