新着
NetCommonsとは関係ありません。個人的メモ   Private Sub...
お知らせ
12/08
確認用ルーム
NetCommonsとは関係ありません。個人的メモ   Private Sub CommandButton実行_Click()Dim my住所録 As Class住所録: Set my住所録 = New Class住所録With Sheet1  Dim i As Long: i = 2  Do While .Cells(i, 1).Value <> ""   Dim p As ClassPerson: Set p = New ClassPerson   p.Initialize .Range(.Cells(i, 1), .Cells(i, 4))  my住所録.addPerson p, p.Name   i = i + 1  LoopEnd With 'クラスにもっているコレクションの要素を取得Debug.Print "my住所録"set p = my住所録.getPerson("Bob") Debug.Print p.id End Sub   ■■ classPerson ■■ Public FirstName As StringPublic Gender As StringPublic Birthday As String Public Sub Greet()  MsgBox Me.FirstName & "です、こんにちは!"End Sub Public Sub Initialize(ByVal rng As Range)  id_ = rng(1).Value  FirstName = rng(2).Value Gender = rng(3).Value  Birthday = rng(4).ValueEnd Sub Public Property Get IsMale() As Boolean  IsMale = (Me.Gender = "male")End Property Public Property Get Id() As String  Id = id_End Property Public Property...