|
|
Знак Зодиака (номер или название) по дате рождения
Public Function ZodiacSignID(vBDDate) As Variant
Select Case CInt(Format(vBDDate, "mmdd"))
Case 321 To 420: ZodiacSignID = 1
Case 421 To 520: ZodiacSignID = 2
Case 521 To 621: ZodiacSignID = 3
Case 622 To 722: ZodiacSignID = 4
Case 723 To 823: ZodiacSignID = 5
Case 824 To 923: ZodiacSignID = 6
Case 924 To 1023: ZodiacSignID = 7
Case 1024 To 1122: ZodiacSignID = 8
Case 1123 To 1221: ZodiacSignID = 9
Case 1222 To 1231: ZodiacSignID = 10
Case 101 To 120: ZodiacSignID = 10
Case 121 To 220: ZodiacSignID = 11
Case 221 To 320: ZodiacSignID = 12
End Select
ZodiacSignID_End:
Exit Function
ZodiacSignID_Err:
Err.Clear
Resume ZodiacSignID_End
End Function
Название (после определения номера):
Public Function ZodiacSignName(vBDDate) As Variant
Dim iSignNo As Integer
iSignNo = ZodiacSignID(vBDDate)
ZodiacSignName = Choose(iSignNo, "Овен", "Телец", "Близнецы", "Рак", _
"Лев", "Дева", "Весы", "Скорпион", "Стрелец", "Козерог", "Водолей", "Рыбы")
End Function
Иконка зодиака по номеру знака (для красоты)
Public Function ZodiacSignIcon(iSignID As Integer) As String
Dim lVal As Long
ZodiacSignIcon = ChrW(&H2647 + iSignID)
End Function
Private Sub RowSourceForComboBox(ctrl As ComboBox)
Dim iVal%, sRowSource$
For iVal = 1 To 12
sRowSource = sRowSource & ";" & _
iVal & ";""" & Choose(iVal, "Овен", "Телец", "Близнецы", "Рак", _
"Лев", "Дева", "Весы", "Скорпион", "Стрелец", "Козерог", "Водолей", "Рыбы") & """;" & _
"""" & ChrW(&H2647 + iVal) & """"
Next
ctrl.RowSource = Mid(sRowSource, 2)
End Sub
|
|