Fortune Telling Collection - Zodiac Guide - How is the zodiac calculated? Knowing a date of 2065438+April 20, how to calculate the zodiac and constellation with vba?
How is the zodiac calculated? Knowing a date of 2065438+April 20, how to calculate the zodiac and constellation with vba?
AnimalStr = "Rats, cows, tigers, rabbits, dragons, snakes, horses, sheep, monkeys, chickens, dogs and pigs"
Sx = Mid(animalStr, (year (a)-1 900) mod12+1,1)
End function
Function xz (date) as a string.
ConstellationName = "Aries, Taurus, Gemini, Cancer, Leo, Virgo, Libra, Scorpio, Sagittarius, Capricorn, Aquarius, Pisces"
Exponent = 0
Y = year (a)
M = month (a)
D = day (a)
y = m * 100 + d
If ((y>= 32 1) and (y<= 4 19)), then
Exponent = 0
else if((y & gt; = 420) and (y < = 520)) then
Exponent = 1
else if((y & gt; = 52 1) and (y < = 620)) then
Exponent = 2
else if((y & gt; = 62 1) and (y < = 722)) then
Exponent = 3
else if((y & gt; = 723) and (y < = 822)) then
Exponent = 4
else if((y & gt; = 823) and (y < = 922)) then
Exponent = 5
else if((y & gt; = 923) and (y < =1022)) then
Exponent = 6
else if((y & gt; = 1023) and (y < =1121)) then.
Index = 7
else if((y & gt; = 1 122) and (y < =1221)) then
Exponent = 8
else if((y & gt; = 1222) or (y < =119)) then
Exponent = 9
else if((y & gt; = 120) and (y < = 218)) then
Exponent = 10
else if((y & gt; = 2 19) and (y < = 320)) then
Exponent = 1 1
Otherwise:
Exponent = 0
If ... it will be over.
xz = Mid(constellationName,Index * 4 + 1,3)
End function
- Related articles
- Who plays Jiang Dehua in "The Love of Parents"?
- What major did Buffett graduate from?
- Where does the zodiac man check in?
- What constellation is in front of Taurus _ What constellation is the best in front of Taurus?
- What constellation do you think is the best for girls to dye blue hair?
- What constellations are you talking about that live an independent personality without being pushed around?
- 198 1 Lunar June 1 1 What life was born?
- Judge your position in Sagittarius men's hearts, and how to test whether Sagittarius boys like you.
- Vivian is beautiful enough in this play, but it happened that a Chen Hong came, which is simply a comparison.
- Seek 0 basic arrangement teaching introductory video tutorial Baidu cloud network disk resource download, thank you!