Función para hallar el signo y elemento zodiacal a partir de una fecha en Excel

Código

Function IB·SignoZodiacal(FechaNacimiento As Date, Optional Elemento As Boolean = False) As String
Dim D As Integer, H As Integer
D = Day(FechaNacimiento)
H = Month(FechaNacimiento)
Select Case H
Case 1
If D <= 19 Then
If Elemento Then
IB·SignoZodiacal = "Tierra"
Else
IB·SignoZodiacal = "Capricornio"
End If
Else
If Elemento Then
IB·SignoZodiacal = "Aire"
Else
IB·SignoZodiacal = "Acuario"
End If
End If
Case 2
If D <= 18 Then
If Elemento Then
IB·SignoZodiacal = "Aire"
Else
IB·SignoZodiacal = "Acuario"
End If
Else
If Elemento Then
IB·SignoZodiacal = "Agua"
Else
IB·SignoZodiacal = "Piscis"
End If
End If
Case 3
If D <= 20 Then
If Elemento Then
IB·SignoZodiacal = "Agua"
Else
IB·SignoZodiacal = "Piscis"
End If
Else
If Elemento Then
IB·SignoZodiacal = "Fuego"
Else
IB·SignoZodiacal = "Aries"
End If
End If
Case 4
If D <= 19 Then
If Elemento Then
IB·SignoZodiacal = "Fuego"
Else
IB·SignoZodiacal = "Aries"
End If
Else
If Elemento Then
IB·SignoZodiacal = "Tierra"
Else
IB·SignoZodiacal = "Tauro"
End If
End If
Case 5
If D <= 20 Then
If Elemento Then
IB·SignoZodiacal = "Tierra"
Else
IB·SignoZodiacal = "Tauro"
End If
Else
If Elemento Then
IB·SignoZodiacal = "Aire"
Else
IB·SignoZodiacal = "Géminis"
End If
End If
Case 6
If D <= 20 Then
If Elemento Then
IB·SignoZodiacal = "Aire"
Else
IB·SignoZodiacal = "Géminis"
End If
Else
If Elemento Then
IB·SignoZodiacal = "Agua"
Else
IB·SignoZodiacal = "Cáncer"
End If
End If
Case 7
If D <= 22 Then
If Elemento Then
IB·SignoZodiacal = "Agua"
Else
IB·SignoZodiacal = "Cáncer"
End If
Else
If Elemento Then
IB·SignoZodiacal = "Fuego"
Else
IB·SignoZodiacal = "Leo"
End If
End If
Case 8
If D <= 22 Then
If Elemento Then
IB·SignoZodiacal = "Fuego"
Else
IB·SignoZodiacal = "Leo"
End If
Else
If Elemento Then
IB·SignoZodiacal = "Tierra"
Else
IB·SignoZodiacal = "Virgo"
End If
End If
Case 9
If D <= 22 Then
If Elemento Then
IB·SignoZodiacal = "Tierra"
Else
IB·SignoZodiacal = "Virgo"
End If
Else
If Elemento Then
IB·SignoZodiacal = "Aire"
Else
IB·SignoZodiacal = "Libra"
End If
End If
Case 10
If D <= 22 Then
If Elemento Then
IB·SignoZodiacal = "Aire"
Else
IB·SignoZodiacal = "Libra"
End If
Else
If Elemento Then
IB·SignoZodiacal = "Agua"
Else
IB·SignoZodiacal = "Escorpio"
End If
End If
Case 11
If D <= 21 Then
If Elemento Then
IB·SignoZodiacal = "Agua"
Else
IB·SignoZodiacal = "Escorpio"
End If
Else
If Elemento Then
IB·SignoZodiacal = "Fuego"
Else
IB·SignoZodiacal = "Sagitario"
End If
End If
Case 12
If D <= 21 Then
If Elemento Then
IB·SignoZodiacal = "Fuego"
Else
IB·SignoZodiacal = "Sagitario"
End If
Else
If Elemento Then
IB·SignoZodiacal = "Tierra"
Else
IB·SignoZodiacal = "Capricornio"
End If
End If
End Select
End Function

Comentarios

Publicar un comentario