battrach 1.3.1

3
CHỌN HƯỚNG TỐT THEO PHONG THUỶ BÁT TRẠCH Ngày sinh (DL): 1 Tháng sinh (DL): 1 Năm sinh (DL): 1!" Gi#i $%nh&N'm: Năm y nhà: Chi*+ ng'ng nhà , Chi*+ -./ nhà 10 m23/h : 456LUE7 T8/ ngày : 456LUE7 9+m;nh: 456LUE7 H<#ng nhà =h>mTh?y Ng@ hành: 456LUE7 T'm $'i năm A$ i: 456LUE7 Hn s' năm A$ i: 456LUE7 4 CHÚ THÍCH Các hướng tốt: 456LUE7 (BFm à 5 ng $I n 456LUE7 Ng@ hành JK m M ngh ' 456LUE7 /á/ /+ng) 456LUE7 Ph n m*m J< / iQ$ Si=T TI n Ng./ D@ngE Công ty CP Tư vấn Xây dựng v Phát t!"#n Thư$ng %&" '"(t N)% C*C+, -.C B N / T E i$ EUL6 XXX YYY H 2Z 9+'y $I'i Rs$ 9+'y Zh'i

Upload: hoa-nguyen

Post on 06-Oct-2015

53 views

Category:

Documents


3 download

DESCRIPTION

phong thuy

TRANSCRIPT

Tinh tuoiCHN HNG TTTHEO PHONG THU BT TRCHNgy sinh (DL):1Thng sinh (DL):1Nm sinh (DL):1963Gii tnh/Nam:Nm xy nh:Chiu ngang nh4Chiu dc nh15m lch :0Tc ngy :Ngy Gip Thn, Thng Qu Su, Nm Nhm Dn, Gi Gip TQu mnh:Tn McHng nhKhm ThyHng k tui:Phc cNg hnh:Kim Bc Kim (Kim Vng Bc)Tam tai nm Gip Ng:Kim LuHn sao nm Gip Ng:Thi Bch (Kim Tinh) [15 AL]Phn mm c vit biKTS. Trn Ngc DngEmail: [email protected] THCHCc hng tt:Bc (Sinh Kh)(Bm vo Vng trnng Nam (Phc c)Ng hnh xem nghaNam (Thin Y)cc cung)ng Nam (Phc V)

B trng nu l NNp Thng trc Ngy sauB trng nu xt nm hin tiCng ty CP T vn Xy dng v Pht trin Thng mi Vit Nam CICOM JSCBNTPhn mm c vit biKTS. Trn Ngc DngEmail: [email protected]

HuongdanHNG DN S DNG1V phng thc hot ng ca phn mmPhn mm hot ng bng Macro v ngn ng lp trnh VBA tch hp sn trong mi trng ca b Office. V vy, phn mm c th hot ng, bncn phi gim mc Security xung Low. Hy nh mi ngi xung quanh tr gip nu bn khng bit ty chn ny u. Nu bn khng thc hin iuny, phn mm s khng chy hoc cho thng tin sai.2V phng thc nhp d liuaMc Ngy thng nm sinhMc ny cho php bn nhp Ngy thng nm sinh theo Dng lch ca bn, phn mm s t quy i sang ngy m lch. Nu bn sinh vo ngy cui thngdo cch sp xp theo thi quen nhp Ngy trc thng sau, c th phn mm s bo li ngy thng (Trng hp Thng in sn thng 2 m bn inngy 30 chng hn). Gp trng hp ny bn hy in Thng trc, ri mi in ngy.Do tc gi khng trc tip lp trnh phn quy i ngy m dng, nn c th thng tin v ngy m lch trc nm 1900 s khng chnh xc. Tuy nhinbn vn c th in Ngy thng trc nm 1900 xem cc thng tin v Bt trch nu mun. Thng tin ny vn ph hp cho nhng nm trc 1900.bMc Gii tnhBn c th in mt k t bt k vo Gii tnh nu l Nam. Nu l N, bt buc bn phi trng ny (khng cha bt k k t g k c du cch).bn c th lm vic ny bng vic bm phm Delete vo Gii tnh.cMc Nm xy nhin nm d kin xy nh ca bn xem hn tt xu ca nm i vi bn. C th xa trng ny hiu l nm hin ti (2014)dMc chiu di v chiu rng nh v hnh th ngi nhTheo lp trnh, V tr ca vo (Hng nh) l hng ln trn (V tr c mi tn ). Bn cn xoay Bt qui n ng hng thc t o c bng la bn.Chiu di v Chiu rng c th hin trn t l tng i gia Chiu ngang v Chiu dc nh.3Cc thng tin do phn mm cung cpaThng tin v Ngy thng nm sinh theo m lch v can chi ca ngy thng nm sinh m lch, thng tin v mnh trch...bCc thng tin v hn sao, hn tam tai tham kho phc v xy nhcThng tin v cc hng tt nn s dng tham khod ngha v cc cung trong Bt trch. Bn c th bm vo vng trn Ng hnh tng sinh - tng khc xem.eMu sc hp mnh, nn s dng trong ngi nh, hoc s dng vo cc vn khc trong cuc sng ca bn.fTnh cht ng hnh vi cc s vt trong cuc sng, bn c th bm vo cc mu sc xem4Ghi chMi thng tin do phn mm cung cp ch mang tnh tham kho. xem qua, ng lun vo khng m ra khi khi ng phn mm (in k t bt k)

DulieuNamHng nhKhm ThyDNamNNam K hngN K hngNam tt nhtNgyNu1Khm ThyCn ThThin Y - Phc cSinh Kh - Phc VPhc cThngng Nam (Sinh Kh)Bc (Phc V)ng (Thin Y)Nam (Phc c)Sinh KhTham LangMcTy Bc (Thin Y)Ty (Phc c)Ty Nam (Sinh Kh)ng Bc (Phc V)Nm sinh theo AL19622Ly HaCn KimThin Y - Phc VSinh KhThin YNmng (Sinh Kh)Nam (Phc V)ng Nam (Thin Y)Bc (Phc c)Phc cV KhcKimng Bc (Thin Y)Ty Nam (Phc c)Ty (Sinh Kh)Ty Bc (Phc V)S d chung9Tn McPhc c3Cn Thoi KimSinh Kh - Phc VSinh KhThin YGiTy Bc (Thin Y)Ty (Phc c)Ty Nam (Sinh Kh)ng Bc (Phc V)Thin YC MnThTy Nam (Thin Y)ng Bc (Phc c)Ty Bc (Sinh Kh)Ty (Phc V)4oi KimCn ThSinh KhSinh Kh - Phc VPhc cTy Nam (Thin Y)ng Bc (Phc c)Ty Bc (Sinh Kh)Ty (Phc V)Phc VPh BtMcTy Bc (Thin Y)Ty (Phc c)Ty Nam (Sinh Kh)ng Bc (Phc V)20145Cn KimLy HaSinh KhThin Y - Phc VPhc cng Bc (Thin Y)Ty Nam (Phc c)Ty (Sinh Kh)Ty Bc (Phc V)Tuyt MnhPh QunKimng (Sinh Kh)Nam (Phc V)ng Nam (Thin Y)Bc (Phc c)Tui xy nh536Khn ThKhm ThyPhc VThin Y - Phc cThin YTy (Thin Y)Ty Bc (Phc c)ng Bc (Sinh Kh)Ty Nam (Phc V)Ng QuLim TrinhHong Nam (Sinh Kh)Bc (Phc V)ng (Thin Y)Nam (Phc c)Kim Lu00Kim LuKim Lu7Tn McKhn ThPhc cPhc VSinh KhBc (Sinh Kh)ng Nam (Phc c)Nam (Thin Y)ng Nam (Phc V)Lc StVn KhcThuTy (Thin Y)Ty Bc (Phc c)ng Bc (Sinh Kh)Ty Nam (Phc V)Tui hin ti538Chn McChn McPhc cPhc cSinh KhNam (Sinh Kh)ng Nam (Phc c)Bc (Thin Y)ng (Phc V)Ha HiLc TnThNam (Sinh Kh)ng Nam (Phc c)Bc (Thin Y)ng (Phc V)9Khn ThTn McPhc VPhc cThin YTy (Thin Y)Ty Bc (Phc c)ng Bc (Sinh Kh)Ty Nam (Phc V)Bc (Sinh Kh)ng Nam (Phc c)Nam (Thin Y)ng Nam (Phc V)201446GipNgNamsinh /193622NhmDnNamxem08CanhThn26Kim Bc KimKim Vng BcThin Cana chi ngha Thin CanTT1TT2TT3XEM TUI XY NH7Thi Bch (Kim Tinh) [15 AL]Thi Bch (Kim Tinh) [15 AL]1Tn0T234m KimHnNamN2Nhm1Su0111Dng ThuNm d nh xy nh :20146Ng0La Hu [8 AL]K [18 AL]3Qu2Dn8910m Thu1Th T (Th Tinh) [18 AL]Th tinhVn Hn (Ho Tinh)4Gip3Mo567Dng McTui ALKim LuHoang cTam TaiNm sinh2Thu Diu (Thu Tinh)Thu TinhMc c (Mc Tinh)5t4Thn234m McDLAL3Thi Bch (Kim Tinh) [15 AL]Kim TinhThi m6Bnh5T0111Dng Ho20x199511Hi04Thi DngTh T (Th Tinh) [18 AL]7inh6Ng8910m Ho21xx0199410Tut05Vn Hn (Ho Tinh)Ho TinhLa Hu [8 AL]8Mu7Mi567Dng Th22019939Du06K [18 AL]Thi Dng9K8Thn234m Th23x019928Thn07Thi mThi Bch (Kim Tinh) [15 AL]0Canh9Du0111Dng Kim24xxx19917Mi08Mc c (Mc Tinh)Mc TinhThu Diu (Thu Tinh)10Tut891025019906Ng011Hi56726x019895T027x019884Thn0Y nghia cung:1) SINH KH thuc Mc l du nin rt tt, em sc sng mnh v ngun sanh li lc vo nh. ng t trch th hp trch (hp vi nh), khin cho nh thnh vng ln, v Mc vi Kim tng khc. Sinh kh lm Chn Tn Mc l ng din tt nhiu hn lm Khm Ly Thu l c v, cn lm Kin oi Cn Khn l tht v tt t. (Phm du nin gp cung t ho l ng din tt bc nht, gp cung tng sanh l c v tt bc nh, gp cung tng khc l tht v tt bc ba).

2) DIN NIN thuc Kim l du nin rt tt, c ngha l tui th, lm bn s pht t, th nht l pht t ti ngn, chu o. Cng gi n l thn phc c. Ty t trch th hp trch (hp vi nh), khin cho nh thnh vng ln, v Kim gp Kim thnh Vng kh. Bng ng t trch l khng hp vi nh, v Kim vi Mc tng khac. Nh Din nin lm kin oi l ng din tt nhiu hn lm Cn Khn Khm l c v, cn lm Chn Tn Ly l tht v t tt.

3) THIN Y thuc Th l du nin rt tt, lm hng vng in sn, t vn, lc sc. N c tnh cch nh mt lng y, mt cu tinh nng gii tr tai hon, nng gia tng phc c. Ty t trch th n hp vi nh v Th sanh nh Kim, bng ng t trch khng hp vi nh v nh Mc khc Th. Thin y lm Cn Khn l t ho ng din tt nhiu hn lm Kin oi Ly l tng sanh c v, cn lm Chn Tn Khm l tng khc tht v tt t.

4) PHC V thuc Mc l du nin tt ph thuc, c tnh cch ph tr, tip thm. chung vi Phng ch hay Sn ch v Bp tha Sinh kh, Din nin, Thin y th n tt theo, bng tha hung du nin th n chng ra g. ng t trch th n hp vi nh v Mc p Mc sanh vng kh, bng Ty t trch th n khng hp vi nh v nh Kim khc Mc. Phc v lm Chn Tn l t ho ng din tt hn lm Khm Ly l tng sanh c v, bng lm Kin oi Cn Khn l tng khc tht v tt t.

5) TUYT MNH thuc Kim l du nin rt hung hi, em tuyt kh vo nh, sinh k rt bt li. N cung no cng gy tai ho, d t ho hay tng sanh cng vy (d ng din hay c v cng vy). ng t trch c n th nguy lm v n Kim khc nh Mc.

6) NG QU thuc Ho l du nin rt hung, em tai ho vo nh, th nht l nhng chuyn qui d, bnh hon v cc tai nn mu la. Bp gp n xu nht. Ty t trch c n th nguy nht v n Ho khc nh Kim. D n ng din hay c v cng hung.

7) LC ST thuc Thu l hung du nin, em st kh vo nh, chuyn ng v cc tai nn nc, t di, dm ng. N Bp hi nhiu hn cc ch khc. Ci sc lc gy tai ho ca n km hn Ng qu v Tuyt mnh, v n thuc Thu i vi ng t trch hay Ty t trch u tng sanh.

8) HO HI thuc Th l mt hung du nin, em hung kh vo nh, sanh nhiu hao hi. Ci sc hung hi ca n tng ng hoc nh hn Lc st. i vi ng t trch tng sanh, i vi Ty t trch n b khc, khng nguy hi bng Tuyt mnh v Ng qu.28xx19873Mo0Ng hnh29x019862Dn00Gin H ThuNc di lch30xx019851Su01Gin H ThuNc di lch31019840T02Thnh u Tht u thnh32xx198311Hi03Thnh u Tht u thnh33xx0198210Tut04Bch Lp KimVng Bch Kim34019819Du05Bch Lp KimVng Bch Kim35x019808Thn06Dng Liu McG Dng liu36xx19797Mi07Dng Liu McG Dng liu37x019786Ng08Tuyn Trung ThuNc trong khe38x019775T09Tuyn Trung ThuNc trong khe39xx019764Thn010c Thng Tht trn mi nh40x19753Mo011c Thng Tht trn mi nh41x019742Dn012Tch Lch HoLa sm chp42xx019731Su013Tch Lch HoLa sm chp43019720T014Tng Bch McG tng bch44xx197111Hi015Tng Bch McG tng bch45x0197010Tut016Trng Lu ThuNc gia dng46x019699Du017Trng Lu ThuNc gia dng47x019688Thn018Sa Trung KimVng trong ct48xxx19677Mi019Sa Trung KimVng trong ct49019666Ng020Sn H HoLa chn ni50x019655T021Sn H HoLa chn ni51xx019644Thn022Bnh a McG ng bng52x19633Mo023Bnh a McG ng bng53x019622Dn024Bch Thng Tht vch nh54x019611Su025Bch Thng Tht vch nh55x019600T026Kim Bc KimKim Vng Bc56xx195911Hi027Kim Bc KimKim Vng Bc57xx0195810Tut028Ph ng HoLa trong n58019579Du029Ph ng HoLa trong n59019568Thn030Thin H ThuNc trn tri60xxx19557Mi0Phn mm c vit biKTS. Trn Ngc DngEmail: [email protected] H ThuNc trn tri61019546Ng032i Dch Tht vn ln62x019535T033i Dch Tht vn ln63x019524Thn0Cng ty CP T vn Xy dng v Pht trin Thng mi Vit Nam CICOM JSC34Thoa Xuyn KimVng trang sc64xx19513Mo035Thoa Xuyn KimVng trang sc65x019502Dn036Tang Thch McG cy du66xx019491Su037Tang Thch McG cy du67019480T038i Kh ThuNc khe ln68x194711Hi039i Kh ThuNc khe ln69xx0194610Tut040Sa Trung Tht trong ct70019459Du041Sa Trung Tht trong ct71x019448Thn042Thin Thng HoLa trn tri72xx19437Mi043Thin Thng HoLa trn tri73x019426Ng044Thch Lu McG cy lu74x019415T045Thch Lu McG cy lu46i Hi ThuNc bin ln47i Hi ThuNc bin ln48Hi Trung KimVng di bin49Hi Trung KimVng di bin50L Trung HoLa trong l51L Trung HoLa trong l52i Lm McG trong rng53i Lm McG trong rng54L Bng Tht ven ng55L Bng Tht ven ng56Kim Phong KimSt u kim57Kim Phong KimSt u kim58Sn u HoLa nh ni59Sn u HoLa nh ni0Gin H Thu1Gin H Thu2Thnh u Th3Thnh u Th4Bch Lp Kim5Bch Lp Kim6Dng Liu Mc7Dng Liu Mc8Tuyn Trung Thu9Tuyn Trung Thu10c Thng Th11c Thng Th12Tch Lch Ho13Tch Lch Ho14Tng Bch Mc15Tng Bch Mc16Trng Lu Thu17Trng Lu Thu18Sa Trung Kim19Sa Trung Kim20Sn H Ho21Sn H Ho22Bnh a Mc23Bnh a Mc24Bch Thng Th25Bch Thng Th26Kim Bc Kim27Kim Bc Kim28Ph ng Ho29Ph ng Ho30Thin H Thu31Thin H Thu32i Dch Th33i Dch Th34Thoa Xuyn Kim35Thoa Xuyn Kim36Tang Thch Mc37Tang Thch Mc38i Kh Thu39i Kh Thu40Sa Trung Th41Sa Trung Th42Thin Thng Ho43Thin Thng Ho44Thch Lu Mc45Thch Lu Mc46i Hi Thu47i Hi Thu48Hi Trung Kim49Hi Trung Kim50L Trung Ho51L Trung Ho52i Lm Mc53i Lm Mc54L Bng Th55L Bng Th56Kim Phong Kim57Kim Phong Kim58Sn u Ho59Sn u Ho

Phn mm c vit biKTS. Trn Ngc DngEmail: [email protected] ty CP T vn Xy dng v Pht trin Thng mi Vit Nam CICOM JSC

Attribute VB_Name = "Module1"Private Type solardate solarday As Integer solarmonth As Integer solaryear As IntegerEnd TypePrivate Type solarlunar sdate As solardate evallunar As Integer leapmoon As Integer 'chi co hai gia tri la 0 hoac 1End TypePrivate Type lunardate lunarday As Integer lunarmonth As Integer lunaryear As Integer leapmoon As Integer 'chi co hai gia tri la 0 hoac 1End Type Const PI = 3.14159265358979 + 3.238462643383E-15 + 2.795E-28Sub Picture_NH_Click() Load UserForm1 UserForm1.Show End SubSub SPColor_Click() Load UserForm2 UserForm2.Show End Sub Private Function UniversalToJD(ByVal solarday As Integer, ByVal solarmonth As Integer, ByVal solaryear As Integer) As Double'tra ve 1 ngay julius cua ngay duong lich Dim jd As Double If (solaryear > 1582 Or (solaryear = 1582 And solarmonth > 10) Or (solaryear = 1582 And solarmonth = 10 And solarday > 14)) Then jd = 367 jd = jd * solaryear jd = jd - Int(7 * (solaryear + Int((solarmonth + 9) / 12)) / 4) jd = jd - Int(3 * (Int((solaryear + (solarmonth - 9) / 7) / 100) + 1) / 4) jd = jd + Int(275 * solarmonth / 9) jd = jd + solarday jd = jd + 1721028.5 Else jd = 367 jd = jd * solaryear jd = jd - Int(7 * (solaryear + 5001 + Int((solarmonth - 9) / 7)) / 4) jd = jd + Int(275 * solarmonth / 9) jd = jd + solarday jd = jd + 1729776.5 End If UniversalToJD = jdEnd Function Private Function solar2lunar(ByVal solarday As Integer, ByVal solarmonth As Integer, ByVal solaryear As Integer, ByVal local_timezone As Byte) As lunardate Dim ly() As solarlunar Dim jdToday, jdMonth11 As Double Dim month11 As solardate Dim i, dd, mm, yy As Integer yy = solaryear lunaryear solaryear, ly(), local_timezone month11 = ly(UBound(ly)).sdate jdToday = LocalToJD(solarday, solarmonth, solaryear, local_timezone) jdMonth11 = LocalToJD(month11.solarday, month11.solarmonth, month11.solaryear, local_timezone) If (jdToday >= jdMonth11) Then lunaryear solaryear + 1, ly(), local_timezone yy = solaryear + 1 End If i = UBound(ly) Do While (jdToday < LocalToJD(ly(i).sdate.solarday, ly(i).sdate.solarmonth, ly(i).sdate.solaryear, local_timezone)) i = i - 1 Loop dd = Int(jdToday - LocalToJD(ly(i).sdate.solarday, ly(i).sdate.solarmonth, ly(i).sdate.solaryear, local_timezone)) + 1 mm = ly(i).evallunar If (mm >= 11) Then yy = yy - 1 End If With solar2lunar .leapmoon = ly(i).leapmoon .lunarday = dd .lunarmonth = mm .lunaryear = yy End WithEnd Function Private Sub lunaryear(ByVal solaryear As Integer, ret() As solarlunar, ByVal local_timezone As Byte) Dim jdmonth11A, off As Double Dim k, i, foundI, j As Integer Dim sunlongitudes(1 To 14) As Double Dim foundB, hasMajorTerm, p1, p2, leap As Boolean Dim sl1, sl2, sl3, sl4, kl As Double Dim SUNLONG_MAJOR(1 To 12) As Double jdmonth11A = LocalToJD(LunarMonth11(solaryear - 1, local_timezone).solarday, LunarMonth11(solaryear - 1, local_timezone).solarmonth, LunarMonth11(solaryear - 1, local_timezone).solaryear, local_timezone) k = Int(0.5 + (jdmonth11A - 2415021.07699869 - 0.000000005) / 29.530588853) 'k la ngay soc cua mong 1 thang 11 nam solaryear -1 off = LocalToJD(LunarMonth11(solaryear, local_timezone).solarday, LunarMonth11(solaryear, local_timezone).solarmonth, LunarMonth11(solaryear, local_timezone).solaryear, local_timezone) - jdmonth11A leap = off > 365 If leap Then ReDim Preserve ret(1 To 14) 'neu la nam nhuan thi tu thang 11 nam nay den thang 11nam sua se co 14 ngay soc tat ca Else ReDim Preserve ret(1 To 13) 'neu khong nhuan thi se co 13 ngay soc tat ca End If For i = 1 To UBound(ret) With ret(i) .sdate = LocalFromJD(NewMoon(k + i - 1), local_timezone) .evallunar = MOD1(i + 10, 12) .leapmoon = 0 End With Next If (leap) Then 'den day thi chac chan nam nay se la nam nhuan 'nen so ngay soc se la 14 ngay trong nam For i = 0 To 11 SUNLONG_MAJOR(i + 1) = i * PI / 6 Next 'tao ra 12 tiet khi tu (0 den 11)*pi/6 For i = 1 To 14 kl = LocalToJD(ret(i).sdate.solarday, ret(i).sdate.solarmonth, ret(i).sdate.solaryear, local_timezone) sunlongitudes(i) = SunLongitude(kl) Next 'tinh ra trung khi cua nhung thang am lich foundB = False For i = 1 To 13 sl1 = sunlongitudes(i) sl2 = sunlongitudes(i + 1) 'trung khi cua hai thang lien tiep hasMajorTerm = False For j = 1 To 11 sl3 = SUNLONG_MAJOR(j) sl4 = SUNLONG_MAJOR(j + 1) p1 = ((sl3 < sl1) And (sl1 < sl2) And (sl2 < sl4)) p2 = ((sl3 < sl2) And (sl2 < sl1) And (sl1 < sl4)) If (p1 Or p2) Then hasMajorTerm = True End If If hasMajorTerm Then ret(i).leapmoon = 1 ret(i).evallunar = MOD1(i + 9, 12) foundB = True foundI = i Exit For End If Next If foundB Then Exit For End If Next For i = foundI + 1 To 14 ret(i).evallunar = MOD1(i + 9, 12) Next End IfEnd Sub Private Function LocalFromJD(ByVal jd As Double, ByVal local_timezone As Byte) As solardate'tra ve ngay ,thang ,nam cua nam duong lich cho 1 ngay julius tuong ung voi mui gio LocalFromJD = UniversalFromJD(jd + local_timezone / 24)End Function Private Function LocalToJD(ByVal solarday As Integer, ByVal solarmonth As Integer, ByVal solaryear As Integer, ByVal local_timezone As Byte) As Double'tra ve 1 ngay julius cua ngay duong lich voi mui gio LocalToJD = UniversalToJD(solarday, solarmonth, solaryear) - local_timezone / 24End Function Private Function LunarMonth11(ByVal solaryear As Integer, ByVal local_timezone As Byte) As solardate'tnh thang am lich chua ong chi'tra ve ngay mong 1 thang 11 am cua nam solaryear Dim off, jd, sunLong As Double Dim k As Integer Dim ret As solardate off = LocalToJD(31, 12, solaryear, local_timezone) - 2415021.07699869 - 0.000000005 k = Int(off / 29.530588853) jd = NewMoon(k) ret = LocalFromJD(jd, local_timezone) sunLong = SunLongitude(LocalToJD(ret.solarday, ret.solarmonth, ret.solaryear, local_timezone)) If (sunLong > 3 * PI / 2) Then jd = NewMoon(k - 1) End If LunarMonth11 = LocalFromJD(jd, local_timezone)End Function Private Function NewMoon(ByVal k As Integer) As Double'tra ve gia tri cua ngay julius tuong ung voi ngay soc thu k Dim T, T2, T3, dr, JD1, M, Mpr, f, C1, deltat, JdNew T = k / 1236.85 '// Time in Julian centuries from 1900 January 0.5 T2 = T * T T3 = T2 * T dr = PI / 180 JD1 = 2415020.75933 + 29.53058868 * k + 0.0001178 * T2 - 0.000000155 * T3 JD1 = JD1 + 0.00033 * Math.Sin((166.56 + 132.87 * T - 0.009173 * T2) * dr) ' // Mean new moon M = 359.2242 + 29.10535608 * k - 0.0000333 * T2 - 0.00000347 * T3 ' // Sun's mean anomaly Mpr = 306.0253 + 385.81691806 * k + 0.0107306 * T2 + 0.00001236 * T3 ' // Moon's mean anomaly f = 21.2964 + 390.67050646 * k - 0.0016528 * T2 - 0.00000239 * T3 ' // Moon's argument of latitude C1 = (0.1734 - 0.000393 * T) * Math.Sin(M * dr) + 0.0021 * Math.Sin(2 * dr * M) C1 = C1 - 0.4068 * Math.Sin(Mpr * dr) + 0.0161 * Math.Sin(dr * 2 * Mpr) C1 = C1 - 0.0004 * Math.Sin(dr * 3 * Mpr) C1 = C1 + 0.0104 * Math.Sin(dr * 2 * f) - 0.0051 * Math.Sin(dr * (M + Mpr)) C1 = C1 - 0.0074 * Math.Sin(dr * (M - Mpr)) + 0.0004 * Math.Sin(dr * (2 * f + M)) C1 = C1 - 0.0004 * Math.Sin(dr * (2 * f - M)) - 0.0006 * Math.Sin(dr * (2 * f + Mpr)) C1 = C1 + 0.001 * Math.Sin(dr * (2 * f - Mpr)) + 0.0005 * Math.Sin(dr * (2 * Mpr + M)) If (T < -11) Then deltat = 0.001 + 0.000839 * T + 0.0002261 * T2 - 0.00000845 * T3 - 0.000000081 * T * T3 Else deltat = -0.000278 + 0.000265 * T + 0.000262 * T2 End If JdNew = JD1 + C1 - deltat NewMoon = JdNewEnd Function Private Function MOD1(ByVal x As Long, ByVal y As Long) As Long'tra ve gia tri cua so du khi x chia cho y Dim Z Z = x - (y * Int(x / y)) If Z = 0 Then Z = y End If MOD1 = ZEnd Function Private Function SunLongitude(ByVal jdn As Double) As Double'tra ve trung khi cua thang Dim T, T2, dr, M, L0, DL, l T = (jdn - 2451545) / 36525 ' // Time in Julian centuries from 2000-01-01 12:00:00 GMT T2 = T * T dr = PI / 180 ' // degree to radian M = 357.5291 + 35999.0503 * T - 0.0001559 * T2 - 0.00000048 * T * T2 ' // mean anomaly, degree L0 = 280.46645 + 36000.76983 * T + 0.0003032 * T2 ' // mean longitude, degree DL = (1.9146 - 0.004817 * T - 0.000014 * T2) * Math.Sin(dr * M) DL = DL + (0.019993 - 0.000101 * T) * Math.Sin(dr * 2 * M) + 0.00029 * Math.Sin(dr * 3 * M) l = L0 + DL ' // true longitude, degree l = l * dr l = l - PI * 2 * (Int(l / (PI * 2))) ' // Normalize to (0, 2*PI) SunLongitude = lEnd Function Private Function UniversalFromJD(ByVal jd As Double) As solardate'tra ve ngay ,thang ,nam cua nam duong lich cho 1 ngay julius tuong ung Dim Z, A, alpha, B, C, D, E, dd, mm, yyyy Dim f As Double Z = Int(jd + 0.5) f = (jd + 0.5) - Z If (Z < 2299161) Then A = Z Else alpha = Int((Z - 1867216.25) / 36524.25) A = Z + 1 + alpha - Int(alpha / 4) End If B = A + 1524 C = Int((B - 122.1) / 365.25) D = Int(365.25 * C) E = Int((B - D) / 30.6001) dd = Int(B - D - Int(30.6001 * E) + f) If (E < 14) Then mm = E - 1 Else mm = E - 13 End If If (mm < 3) Then yyyy = C - 4715 Else yyyy = C - 4716 End If With UniversalFromJD .solarday = dd .solarmonth = mm .solaryear = yyyy End WithEnd Function Public Function LayThoiGianAL(ByVal solarday As Integer, ByVal solarmonth As Integer, ByVal solaryear As Integer, ByVal local_timezone As Byte) As String Dim Esteam(9) As String Dim Ebranch(11) As String Dim Vsteam(9) As String Dim Vbranch(11) As String Dim ld, lm, ly, llm As Integer Dim str$ 'khai bao thien can tieng anh Esteam(0) = "Jia": Esteam(1) = "Yi": Esteam(2) = "Bing": Esteam(3) = "Ding" Esteam(4) = "Wu": Esteam(5) = "Ji": Esteam(6) = "Geng": Esteam(7) = "Xin" Esteam(8) = "Ren": Esteam(9) = "Gui" 'khai bao thien can tieng viet Vsteam(0) = Worksheets("Dulieu").Range("I19"): Vsteam(1) = Worksheets("Dulieu").Range("I20"): Vsteam(2) = Worksheets("Dulieu").Range("I21"): Vsteam(3) = Worksheets("Dulieu").Range("I22") Vsteam(4) = Worksheets("Dulieu").Range("I23"): Vsteam(5) = Worksheets("Dulieu").Range("I24"): Vsteam(6) = Worksheets("Dulieu").Range("I25"): Vsteam(7) = Worksheets("Dulieu").Range("I16") Vsteam(8) = Worksheets("Dulieu").Range("I17"): Vsteam(9) = Worksheets("Dulieu").Range("I18") 'khai bao dia chi tieng anh Ebranch(0) = "zi": Ebranch(1) = "chou": Ebranch(2) = "Yin": Ebranch(3) = "Mao" Ebranch(4) = "Chen": Ebranch(5) = "Si": Ebranch(6) = "wu": Ebranch(7) = "Wei" Ebranch(8) = "Shen": Ebranch(9) = "You": Ebranch(10) = "Xu": Ebranch(11) = "Hai" 'khai bao dia chi tieng viet Vbranch(0) = Worksheets("Dulieu").Range("K16"): Vbranch(1) = Worksheets("Dulieu").Range("K17"): Vbranch(2) = Worksheets("Dulieu").Range("K18"): Vbranch(3) = Worksheets("Dulieu").Range("K19") Vbranch(4) = Worksheets("Dulieu").Range("K20"): Vbranch(5) = Worksheets("Dulieu").Range("K21"): Vbranch(6) = Worksheets("Dulieu").Range("K22"): Vbranch(7) = Worksheets("Dulieu").Range("K16") Vbranch(8) = Worksheets("Dulieu").Range("K24"): Vbranch(9) = Worksheets("Dulieu").Range("K25"): Vbranch(10) = Worksheets("Dulieu").Range("K26"): Vbranch(11) = Worksheets("Dulieu").Range("K27") With solar2lunar(solarday, solarmonth, solaryear, local_timezone) ld = .lunarday lm = .lunarmonth ly = .lunaryear llm = .leapmoon End With 'tao ngay can chi str = Vsteam(Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10)' AALdaySBsteam.Caption = Esteam(Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) str = str & " " & Vbranch(Int(UniversalToJD(solarday, solarmonth, solaryear) + 1.5) Mod 12)' AALdaySBbranch.Caption = Ebranch(Int(UniversalToJD(solarday, solarmonth, solaryear) + 1.5) Mod 12) str = str & "//" ' 'tao thang can chi str = str & Vsteam((ly * 12 + lm + 3) Mod 10) ' AALmoonSBsteam.Caption = Esteam((ly * 12 + lm + 3) Mod 10)' AALmoonSBbranch.Caption = Ebranch((lm + 1) Mod 12) str = str & " " & Vbranch((lm + 1) Mod 12) str = str & "//" ' If llm Then' Vleapmonth.Caption = "(N)"' Eleapmonth.Caption = "(L)"' Else' Vleapmonth.Caption = ""' Eleapmonth.Caption = ""' End If 'tao nam can chi str = str & Vsteam((ly + 6) Mod 10)' AALyearSBsteam.Caption = Esteam((ly + 6) Mod 10) str = str & " " & Vbranch((ly + 8) Mod 12)' AALyearSBbranch.Caption = Ebranch((ly + 8) Mod 12) str = str & "//" 'tao gio can chi str = str & Vsteam(((Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) Mod 5) * 2)' AALhoursteam.Caption = Esteam(((Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) Mod 5) * 2) LayThoiGianAL = str & " Ty1//" & ld & "/" & lm & "/" & ly & "//" & llm End Function

Public Function CanchiAL(ByVal solarday As Integer, ByVal solarmonth As Integer, ByVal solaryear As Integer, ByVal local_timezone As Byte) As String Dim Esteam(9) As String Dim Ebranch(11) As String Dim Vsteam(9) As String Dim Vbranch(11) As String Dim ld, lm, ly, llm As Integer Dim str$ 'khai bao thien can tieng anh Esteam(0) = "Jia": Esteam(1) = "Yi": Esteam(2) = "Bing": Esteam(3) = "Ding" Esteam(4) = "Wu": Esteam(5) = "Ji": Esteam(6) = "Geng": Esteam(7) = "Xin" Esteam(8) = "Ren": Esteam(9) = "Gui" 'khai bao thien can tieng viet Vsteam(0) = Worksheets("Dulieu").Range("I19"): Vsteam(1) = Worksheets("Dulieu").Range("I20"): Vsteam(2) = Worksheets("Dulieu").Range("I21"): Vsteam(3) = Worksheets("Dulieu").Range("I22") Vsteam(4) = Worksheets("Dulieu").Range("I23"): Vsteam(5) = Worksheets("Dulieu").Range("I24"): Vsteam(6) = Worksheets("Dulieu").Range("I25"): Vsteam(7) = Worksheets("Dulieu").Range("I16") Vsteam(8) = Worksheets("Dulieu").Range("I17"): Vsteam(9) = Worksheets("Dulieu").Range("I18") 'khai bao dia chi tieng anh Ebranch(0) = "zi": Ebranch(1) = "chou": Ebranch(2) = "Yin": Ebranch(3) = "Mao" Ebranch(4) = "Chen": Ebranch(5) = "Si": Ebranch(6) = "wu": Ebranch(7) = "Wei" Ebranch(8) = "Shen": Ebranch(9) = "You": Ebranch(10) = "Xu": Ebranch(11) = "Hai" 'khai bao dia chi tieng viet Vbranch(0) = Worksheets("Dulieu").Range("K16"): Vbranch(1) = Worksheets("Dulieu").Range("K17"): Vbranch(2) = Worksheets("Dulieu").Range("K18"): Vbranch(3) = Worksheets("Dulieu").Range("K19") Vbranch(4) = Worksheets("Dulieu").Range("K20"): Vbranch(5) = Worksheets("Dulieu").Range("K21"): Vbranch(6) = Worksheets("Dulieu").Range("K22"): Vbranch(7) = Worksheets("Dulieu").Range("K16") Vbranch(8) = Worksheets("Dulieu").Range("K24"): Vbranch(9) = Worksheets("Dulieu").Range("K25"): Vbranch(10) = Worksheets("Dulieu").Range("K26"): Vbranch(11) = Worksheets("Dulieu").Range("K27") With solar2lunar(solarday, solarmonth, solaryear, local_timezone) ld = .lunarday lm = .lunarmonth ly = .lunaryear llm = .leapmoon End With 'tao ngay can chi str = Vsteam(Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10)' AALdaySBsteam.Caption = Esteam(Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) str = str & " " & Vbranch(Int(UniversalToJD(solarday, solarmonth, solaryear) + 1.5) Mod 12)' AALdaySBbranch.Caption = Ebranch(Int(UniversalToJD(solarday, solarmonth, solaryear) + 1.5) Mod 12) str = str & ", " & Worksheets("Dulieu").Range("N2") ' 'tao thang can chi str = str & Vsteam((ly * 12 + lm + 3) Mod 10) ' AALmoonSBsteam.Caption = Esteam((ly * 12 + lm + 3) Mod 10)' AALmoonSBbranch.Caption = Ebranch((lm + 1) Mod 12) str = str & " " & Vbranch((lm + 1) Mod 12) str = str & ", " & Worksheets("Dulieu").Range("N3") ' If llm Then' Vleapmonth.Caption = "(N)"' Eleapmonth.Caption = "(L)"' Else' Vleapmonth.Caption = ""' Eleapmonth.Caption = ""' End If 'tao nam can chi str = str & Vsteam((ly + 6) Mod 10)' AALyearSBsteam.Caption = Esteam((ly + 6) Mod 10) str = str & " " & Vbranch((ly + 8) Mod 12)' AALyearSBbranch.Caption = Ebranch((ly + 8) Mod 12) str = str & ", " & Worksheets("Dulieu").Range("N4") 'tao gio can chi str = str & Vsteam(((Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) Mod 5) * 2)' AALhoursteam.Caption = Esteam(((Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) Mod 5) * 2) CanchiAL = Worksheets("Dulieu").Range("N1") & str & " " & Worksheets("Dulieu").Range("K16") End Function

Public Function NgayAL(ByVal solarday As Integer, ByVal solarmonth As Integer, ByVal solaryear As Integer, ByVal local_timezone As Byte) As String Dim Esteam(9) As String Dim Ebranch(11) As String Dim Vsteam(9) As String Dim Vbranch(11) As String Dim ld, lm, ly, llm As Integer Dim str$ 'khai bao thien can tieng anh Esteam(0) = "Jia": Esteam(1) = "Yi": Esteam(2) = "Bing": Esteam(3) = "Ding" Esteam(4) = "Wu": Esteam(5) = "Ji": Esteam(6) = "Geng": Esteam(7) = "Xin" Esteam(8) = "Ren": Esteam(9) = "Gui" 'khai bao thien can tieng viet Vsteam(0) = Worksheets("Dulieu").Range("I19"): Vsteam(1) = Worksheets("Dulieu").Range("I20"): Vsteam(2) = Worksheets("Dulieu").Range("I21"): Vsteam(3) = Worksheets("Dulieu").Range("I22") Vsteam(4) = Worksheets("Dulieu").Range("I23"): Vsteam(5) = Worksheets("Dulieu").Range("I24"): Vsteam(6) = Worksheets("Dulieu").Range("I25"): Vsteam(7) = Worksheets("Dulieu").Range("I16") Vsteam(8) = Worksheets("Dulieu").Range("I17"): Vsteam(9) = Worksheets("Dulieu").Range("I18") 'khai bao dia chi tieng anh Ebranch(0) = "zi": Ebranch(1) = "chou": Ebranch(2) = "Yin": Ebranch(3) = "Mao" Ebranch(4) = "Chen": Ebranch(5) = "Si": Ebranch(6) = "wu": Ebranch(7) = "Wei" Ebranch(8) = "Shen": Ebranch(9) = "You": Ebranch(10) = "Xu": Ebranch(11) = "Hai" 'khai bao dia chi tieng viet Vbranch(0) = Worksheets("Dulieu").Range("K16"): Vbranch(1) = Worksheets("Dulieu").Range("K17"): Vbranch(2) = Worksheets("Dulieu").Range("K18"): Vbranch(3) = Worksheets("Dulieu").Range("K19") Vbranch(4) = Worksheets("Dulieu").Range("K20"): Vbranch(5) = Worksheets("Dulieu").Range("K21"): Vbranch(6) = Worksheets("Dulieu").Range("K22"): Vbranch(7) = Worksheets("Dulieu").Range("K16") Vbranch(8) = Worksheets("Dulieu").Range("K24"): Vbranch(9) = Worksheets("Dulieu").Range("K25"): Vbranch(10) = Worksheets("Dulieu").Range("K26"): Vbranch(11) = Worksheets("Dulieu").Range("K27") With solar2lunar(solarday, solarmonth, solaryear, local_timezone) ld = .lunarday lm = .lunarmonth ly = .lunaryear llm = .leapmoon End With 'tao ngay can chi str = Vsteam(Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10)' AALdaySBsteam.Caption = Esteam(Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) str = str & " " & Vbranch(Int(UniversalToJD(solarday, solarmonth, solaryear) + 1.5) Mod 12)' AALdaySBbranch.Caption = Ebranch(Int(UniversalToJD(solarday, solarmonth, solaryear) + 1.5) Mod 12) str = str & "," ' 'tao thang can chi str = str & Vsteam((ly * 12 + lm + 3) Mod 10) ' AALmoonSBsteam.Caption = Esteam((ly * 12 + lm + 3) Mod 10)' AALmoonSBbranch.Caption = Ebranch((lm + 1) Mod 12) str = str & " " & Vbranch((lm + 1) Mod 12) str = str & "," ' If llm Then' Vleapmonth.Caption = "(N)"' Eleapmonth.Caption = "(L)"' Else' Vleapmonth.Caption = ""' Eleapmonth.Caption = ""' End If 'tao nam can chi str = str & Vsteam((ly + 6) Mod 10)' AALyearSBsteam.Caption = Esteam((ly + 6) Mod 10) str = str & " " & Vbranch((ly + 8) Mod 12)' AALyearSBbranch.Caption = Ebranch((ly + 8) Mod 12) str = str & "," 'tao gio can chi str = str & Vsteam(((Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) Mod 5) * 2)' AALhoursteam.Caption = Esteam(((Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) Mod 5) * 2) NgayAL = ld End Function

Public Function ThangAL(ByVal solarday As Integer, ByVal solarmonth As Integer, ByVal solaryear As Integer, ByVal local_timezone As Byte) As String Dim Esteam(9) As String Dim Ebranch(11) As String Dim Vsteam(9) As String Dim Vbranch(11) As String Dim ld, lm, ly, llm As Integer Dim str$ 'khai bao thien can tieng anh Esteam(0) = "Jia": Esteam(1) = "Yi": Esteam(2) = "Bing": Esteam(3) = "Ding" Esteam(4) = "Wu": Esteam(5) = "Ji": Esteam(6) = "Geng": Esteam(7) = "Xin" Esteam(8) = "Ren": Esteam(9) = "Gui" 'khai bao thien can tieng viet Vsteam(0) = Worksheets("Dulieu").Range("I19"): Vsteam(1) = Worksheets("Dulieu").Range("I20"): Vsteam(2) = Worksheets("Dulieu").Range("I21"): Vsteam(3) = Worksheets("Dulieu").Range("I22") Vsteam(4) = Worksheets("Dulieu").Range("I23"): Vsteam(5) = Worksheets("Dulieu").Range("I24"): Vsteam(6) = Worksheets("Dulieu").Range("I25"): Vsteam(7) = Worksheets("Dulieu").Range("I16") Vsteam(8) = Worksheets("Dulieu").Range("I17"): Vsteam(9) = Worksheets("Dulieu").Range("I18") 'khai bao dia chi tieng anh Ebranch(0) = "zi": Ebranch(1) = "chou": Ebranch(2) = "Yin": Ebranch(3) = "Mao" Ebranch(4) = "Chen": Ebranch(5) = "Si": Ebranch(6) = "wu": Ebranch(7) = "Wei" Ebranch(8) = "Shen": Ebranch(9) = "You": Ebranch(10) = "Xu": Ebranch(11) = "Hai" 'khai bao dia chi tieng viet Vbranch(0) = Worksheets("Dulieu").Range("K16"): Vbranch(1) = Worksheets("Dulieu").Range("K17"): Vbranch(2) = Worksheets("Dulieu").Range("K18"): Vbranch(3) = Worksheets("Dulieu").Range("K19") Vbranch(4) = Worksheets("Dulieu").Range("K20"): Vbranch(5) = Worksheets("Dulieu").Range("K21"): Vbranch(6) = Worksheets("Dulieu").Range("K22"): Vbranch(7) = Worksheets("Dulieu").Range("K16") Vbranch(8) = Worksheets("Dulieu").Range("K24"): Vbranch(9) = Worksheets("Dulieu").Range("K25"): Vbranch(10) = Worksheets("Dulieu").Range("K26"): Vbranch(11) = Worksheets("Dulieu").Range("K27") With solar2lunar(solarday, solarmonth, solaryear, local_timezone) ld = .lunarday lm = .lunarmonth ly = .lunaryear llm = .leapmoon End With 'tao ngay can chi str = Vsteam(Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10)' AALdaySBsteam.Caption = Esteam(Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) str = str & " " & Vbranch(Int(UniversalToJD(solarday, solarmonth, solaryear) + 1.5) Mod 12)' AALdaySBbranch.Caption = Ebranch(Int(UniversalToJD(solarday, solarmonth, solaryear) + 1.5) Mod 12) str = str & "," ' 'tao thang can chi str = str & Vsteam((ly * 12 + lm + 3) Mod 10) ' AALmoonSBsteam.Caption = Esteam((ly * 12 + lm + 3) Mod 10)' AALmoonSBbranch.Caption = Ebranch((lm + 1) Mod 12) str = str & " " & Vbranch((lm + 1) Mod 12) str = str & "," ' If llm Then' Vleapmonth.Caption = "(N)"' Eleapmonth.Caption = "(L)"' Else' Vleapmonth.Caption = ""' Eleapmonth.Caption = ""' End If 'tao nam can chi str = str & Vsteam((ly + 6) Mod 10)' AALyearSBsteam.Caption = Esteam((ly + 6) Mod 10) str = str & " " & Vbranch((ly + 8) Mod 12)' AALyearSBbranch.Caption = Ebranch((ly + 8) Mod 12) str = str & "," 'tao gio can chi str = str & Vsteam(((Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) Mod 5) * 2)' AALhoursteam.Caption = Esteam(((Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) Mod 5) * 2) ThangAL = lm End Function

Public Function NamAL(ByVal solarday As Integer, ByVal solarmonth As Integer, ByVal solaryear As Integer, ByVal local_timezone As Byte) As String Dim Esteam(9) As String Dim Ebranch(11) As String Dim Vsteam(9) As String Dim Vbranch(11) As String Dim ld, lm, ly, llm As Integer Dim str$ 'khai bao thien can tieng anh Esteam(0) = "Jia": Esteam(1) = "Yi": Esteam(2) = "Bing": Esteam(3) = "Ding" Esteam(4) = "Wu": Esteam(5) = "Ji": Esteam(6) = "Geng": Esteam(7) = "Xin" Esteam(8) = "Ren": Esteam(9) = "Gui" 'khai bao thien can tieng viet Vsteam(0) = Worksheets("Dulieu").Range("I19"): Vsteam(1) = Worksheets("Dulieu").Range("I20"): Vsteam(2) = Worksheets("Dulieu").Range("I21"): Vsteam(3) = Worksheets("Dulieu").Range("I22") Vsteam(4) = Worksheets("Dulieu").Range("I23"): Vsteam(5) = Worksheets("Dulieu").Range("I24"): Vsteam(6) = Worksheets("Dulieu").Range("I25"): Vsteam(7) = Worksheets("Dulieu").Range("I16") Vsteam(8) = Worksheets("Dulieu").Range("I17"): Vsteam(9) = Worksheets("Dulieu").Range("I18") 'khai bao dia chi tieng anh Ebranch(0) = "zi": Ebranch(1) = "chou": Ebranch(2) = "Yin": Ebranch(3) = "Mao" Ebranch(4) = "Chen": Ebranch(5) = "Si": Ebranch(6) = "wu": Ebranch(7) = "Wei" Ebranch(8) = "Shen": Ebranch(9) = "You": Ebranch(10) = "Xu": Ebranch(11) = "Hai" 'khai bao dia chi tieng viet Vbranch(0) = Worksheets("Dulieu").Range("K16"): Vbranch(1) = Worksheets("Dulieu").Range("K17"): Vbranch(2) = Worksheets("Dulieu").Range("K18"): Vbranch(3) = Worksheets("Dulieu").Range("K19") Vbranch(4) = Worksheets("Dulieu").Range("K20"): Vbranch(5) = Worksheets("Dulieu").Range("K21"): Vbranch(6) = Worksheets("Dulieu").Range("K22"): Vbranch(7) = Worksheets("Dulieu").Range("K16") Vbranch(8) = Worksheets("Dulieu").Range("K24"): Vbranch(9) = Worksheets("Dulieu").Range("K25"): Vbranch(10) = Worksheets("Dulieu").Range("K26"): Vbranch(11) = Worksheets("Dulieu").Range("K27") With solar2lunar(solarday, solarmonth, solaryear, local_timezone) ld = .lunarday lm = .lunarmonth ly = .lunaryear llm = .leapmoon End With 'tao ngay can chi str = Vsteam(Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10)' AALdaySBsteam.Caption = Esteam(Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) str = str & " " & Vbranch(Int(UniversalToJD(solarday, solarmonth, solaryear) + 1.5) Mod 12)' AALdaySBbranch.Caption = Ebranch(Int(UniversalToJD(solarday, solarmonth, solaryear) + 1.5) Mod 12) str = str & "," ' 'tao thang can chi str = str & Vsteam((ly * 12 + lm + 3) Mod 10) ' AALmoonSBsteam.Caption = Esteam((ly * 12 + lm + 3) Mod 10)' AALmoonSBbranch.Caption = Ebranch((lm + 1) Mod 12) str = str & " " & Vbranch((lm + 1) Mod 12) str = str & "," ' If llm Then' Vleapmonth.Caption = "(N)"' Eleapmonth.Caption = "(L)"' Else' Vleapmonth.Caption = ""' Eleapmonth.Caption = ""' End If 'tao nam can chi str = str & Vsteam((ly + 6) Mod 10)' AALyearSBsteam.Caption = Esteam((ly + 6) Mod 10) str = str & " " & Vbranch((ly + 8) Mod 12)' AALyearSBbranch.Caption = Ebranch((ly + 8) Mod 12) str = str & "," 'tao gio can chi str = str & Vsteam(((Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) Mod 5) * 2)' AALhoursteam.Caption = Esteam(((Int(UniversalToJD(solarday, solarmonth, solaryear) + 9.5) Mod 10) Mod 5) * 2) NamAL = ly End Function

Attribute VB_Name = "UserForm3"Attribute VB_Base = "0{47222E37-F137-435D-82AE-1FC2818B3BAA}{7C6F4334-939F-47AF-835B-8988983D68D9}"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseAttribute VB_TemplateDerived = FalseAttribute VB_Customizable = FalsePrivate Sub CommandButton1_Click() ThisWorkbook.Saved = True Application.QuitEnd Sub

Private Sub CommandButton2_Click() Me.HideEnd Sub

Private Sub Label3_Click()

End Sub

Attribute VB_Name = "Sheet2"Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = TrueAttribute VB_TemplateDerived = FalseAttribute VB_Customizable = True

Attribute VB_Name = "Sheet1"Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = TrueAttribute VB_TemplateDerived = FalseAttribute VB_Customizable = TrueAttribute VB_Control = "Exit, 82, 0, MSForms, CommandButton"Attribute VB_Control = "cmdAbout, 83, 1, MSForms, CommandButton"Attribute VB_Control = "CommandButton1, 14, 2, MSForms, CommandButton"Attribute VB_Control = "CommandButton2, 15, 3, MSForms, CommandButton"Attribute VB_Control = "CommandButton3, 16, 4, MSForms, CommandButton"Attribute VB_Control = "cmdQuickLeft, 104, 6, MSForms, CommandButton"Attribute VB_Control = "cmdQuickRight, 105, 7, MSForms, CommandButton"Attribute VB_Control = "cmdHelp, 107, 8, MSForms, CommandButton"Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub cmdAbout_Click() Load UserForm3 UserForm3.ShowEnd Sub

Private Sub cmdHelp_Click() Worksheets("Huongdan").Visible = True Worksheets("Huongdan").ActivateEnd SubPrivate Sub Worksheet_Activate() Worksheets("Huongdan").Visible = False End SubPrivate Sub cmdQuickLeft_Click()

Shapes("Picture_Kham").Rotation = Shapes("Picture_Kham").Rotation - 15 Shapes("Picture_Ca'n").Rotation = Shapes("Picture_Kham").Rotation Shapes("Picture_Ca-n").Rotation = Shapes("Picture_Kham").Rotation Shapes("Picture_Chan").Rotation = Shapes("Picture_Kham").Rotation Shapes("Picture_Ton").Rotation = Shapes("Picture_Kham").Rotation Shapes("Picture_Doai").Rotation = Shapes("Picture_Kham").Rotation Shapes("Picture_Ly").Rotation = Shapes("Picture_Kham").Rotation Shapes("Picture_Khon").Rotation = Shapes("Picture_Kham").Rotation Shapes("Huong").Rotation = Shapes("Picture_Kham").Rotation 'Xoay cung Phuc Duc 'Kham If Shapes("Picture_Kham").Rotation 67.5 And Shapes("Picture_Kham").Rotation 157.5 And Shapes("Picture_Kham").Rotation 247.5 And Shapes("Picture_Kham").Rotation 292.5 And Shapes("Picture_Kham").Rotation 67.5 And Shapes("Picture_Kham").Rotation 157.5 And Shapes("Picture_Kham").Rotation 247.5 And Shapes("Picture_Kham").Rotation 292.5 And Shapes("Picture_Kham").Rotation 22.5 And Shapes("Picture_Kham").Rotation 112.5 And Shapes("Picture_Kham").Rotation 202.5 And Shapes("Picture_Kham").Rotation 337.5 Then Shapes("Pic_CungPD").Rotation = Shapes("Picture_Kham").Rotation Worksheets("Dulieu").Range("D1") = Worksheets("Dulieu").Range("H2") End If CommandButton1.BringToFront CommandButton2.BringToFront CommandButton3.BringToFront

Shapes("Huong").Left = Shapes("Border").Left + Shapes("Border").Width / 2 - Shapes("Huong").Width / 2 Shapes("Huong").Top = Shapes("Border").Top + Shapes("Border").Height / 2 - Shapes("Huong").Height / 2 Shapes("Picture_Ca'n").Left = Shapes("Border").Left + Shapes("Border").Width / 2 - Shapes("Picture_Ca'n").Width / 2 Shapes("Picture_Ca'n").Top = Shapes("Border").Top + Shapes("Border").Height / 2 - Shapes("Picture_Ca'n").Height / 2 Shapes("Picture_Ca'n").Height = Shapes("Border").Height Shapes("Picture_Ca'n").Width = Shapes("Border").Width Shapes("Picture_Ca-n").Left = Shapes("Border").Left + Shapes("Border").Width / 2 - Shapes("Picture_Ca-n").Width / 2 Shapes("Picture_Ca-n").Top = Shapes("Border").Top + Shapes("Border").Height / 2 - Shapes("Picture_Ca-n").Height / 2 Shapes("Picture_Ca-n").Height = Shapes("Border").Height Shapes("Picture_Ca-n").Width = Shapes("Border").Width Shapes("Picture_Chan").Left = Shapes("Border").Left + Shapes("Border").Width / 2 - Shapes("Picture_Chan").Width / 2 Shapes("Picture_Chan").Top = Shapes("Border").Top + Shapes("Border").Height / 2 - Shapes("Picture_Chan").Height / 2 Shapes("Picture_Chan").Height = Shapes("Border").Height Shapes("Picture_Chan").Width = Shapes("Border").Width Shapes("Picture_Doai").Left = Shapes("Border").Left + Shapes("Border").Width / 2 - Shapes("Picture_Doai").Width / 2 Shapes("Picture_Doai").Top = Shapes("Border").Top + Shapes("Border").Height / 2 - Shapes("Picture_Doai").Height / 2 Shapes("Picture_Doai").Height = Shapes("Border").Height Shapes("Picture_Doai").Width = Shapes("Border").Width Shapes("Picture_Ly").Left = Shapes("Border").Left + Shapes("Border").Width / 2 - Shapes("Picture_Ly").Width / 2 Shapes("Picture_Ly").Top = Shapes("Border").Top + Shapes("Border").Height / 2 - Shapes("Picture_Ly").Height / 2 Shapes("Picture_Ly").Height = Shapes("Border").Height Shapes("Picture_Ly").Width = Shapes("Border").Width Shapes("Picture_Ton").Left = Shapes("Border").Left + Shapes("Border").Width / 2 - Shapes("Picture_Ton").Width / 2 Shapes("Picture_Ton").Top = Shapes("Border").Top + Shapes("Border").Height / 2 - Shapes("Picture_Ton").Height / 2 Shapes("Picture_Ton").Height = Shapes("Border").Height Shapes("Picture_Ton").Width = Shapes("Border").Width Shapes("Picture_Khon").Left = Shapes("Border").Left + Shapes("Border").Width / 2 - Shapes("Picture_Khon").Width / 2 Shapes("Picture_Khon").Top = Shapes("Border").Top + Shapes("Border").Height / 2 - Shapes("Picture_Khon").Height / 2 Shapes("Picture_Khon").Height = Shapes("Border").Height Shapes("Picture_Khon").Width = Shapes("Border").Width Shapes("Picture_Kham").Left = Shapes("Border").Left + Shapes("Border").Width / 2 - Shapes("Picture_Kham").Width / 2 Shapes("Picture_Kham").Top = Shapes("Border").Top + Shapes("Border").Height / 2 - Shapes("Picture_Kham").Height / 2 Shapes("Picture_Kham").Height = Shapes("Border").Height Shapes("Picture_Kham").Width = Shapes("Border").Width'Pic_CungPD Shapes("Pic_CungPD").Left = Shapes("Border").Left + Shapes("Border").Width / 2 - Shapes("Pic_CungPD").Width / 2 Shapes("Pic_CungPD").Top = Shapes("Border").Top + Shapes("Border").Height / 2 - Shapes("Pic_CungPD").Height / 2

End Sub

Private Sub CommandButton4_Click() Dim xScale If Range("E11").Value = LastAngle Then ' For i = LastAngle To pAngle Step 2 ' Shapes("PNH").Rotation = i 'Application.Wait (Now + TimeValue("0:00:01")) 'Call Sleep(100) ' Next i 'Else ' For i = LastAngle To pAngle + 360 Step 2 ' Shapes("PNH").Rotation = i ' 'Application.Wait (Now + TimeValue("0:00:01")) 'Call Sleep(100) ' Next i ' Shapes("PNH").Rotation = pAngle 'End If

End Sub

Private Sub Exit_Click() Application.QuitEnd Sub

Private Sub Worksheet_Change(ByVal Target As Range)On Error GoTo Sub_Err: Dim vCheckDate vCheckDate = DateSerial(Range("E8").Value, Range("E7").Value, Range("E6").Value) If Range("E6").Value Day(vCheckDate) Then MsgBox "Vui long check lai ngay", vbInformation, "Ngay thang khong dung." Range("E6").Value = 1 End If If Range("E7").Value Month(vCheckDate) Then MsgBox "Vui long check lai thang", vbInformation, "Ngay thang khong dung." Range("E7").Value = 1 End If 'If Range("E8").Value < 1900 Then 'MsgBox "Phan am duong lich do tac gia Ho Ngoc Duc cung cap chi ho tro den nam 1900." 'Range("E8").Value = 1900 'End If 'MsgBox CheckDate If Not IsNumeric(Range("E11")) Or Range("E11") < 1 Then MsgBox "Vui long check lai kich thuoc", vbInformation, "Error" Range("E11") = 10 End If If Not IsNumeric(Range("E12")) Or Range("E11") < 1 Then MsgBox "Vui long check lai kich thuoc", vbInformation, "Error" Range("E12") = 10 End If Call CommandButton4_Click Call CommandButton6_Click

Exit SubSub_Err: 'Range("E6").Value = 1 End Sub

Attribute VB_Name = "ThisWorkbook"Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = TrueAttribute VB_TemplateDerived = FalseAttribute VB_Customizable = TruePrivate Sub Workbook_BeforeClose(Cancel As Boolean) Worksheets("Huongdan").Visible = True Worksheets("Huongdan").Activate ActiveWorkbook.Save 'Application.Quit End Sub

Private Sub Workbook_Open()On Error GoTo Sub_Err Dim LoadFirst LoadFirst = GetSetting("Bat trach 1.2.1", "Startup", "First Run", "Never") If LoadFirst "Accepted" Then Load UserForm3 UserForm3.Show SaveSetting "Bat trach 1.2.1", "Startup", "First Run", "Accepted" End If 'Worksheets("Tinh tuoi").Range("D30").Value = Worksheets("Dulieu").Range("A62").Value 'Worksheets("Tinh tuoi").Range("D30").Hyperlinks = Worksheets("Dulieu").Range("A62").Hyperlinks 'Worksheets("Tinh tuoi"). 'Worksheets("Tinh tuoi").Shapes("Rectangle 2").AlternativeText = Worksheets("Dulieu").Range("A65").Text 'Worksheets("Tinh tuoi").Shapes("Rectangle 2").Hyperlink = Worksheets("Dulieu").Range("A65").Hyperlinks Worksheets("Tinh tuoi").Shapes("Rectangle 2").Hyperlink.Follow NewWindow:=True If Worksheets("Huongdan").Range("E34") "" Then Worksheets("Tinh tuoi").Activate Worksheets("Huongdan").Visible = False End IfExit SubSub_Err:Exit SubEnd Sub

Attribute VB_Name = "UserForm1"Attribute VB_Base = "0{058D5817-46A7-4B28-918C-B79F808A888C}{C1A2B26A-3C5E-4FF8-8F27-8AD30E234A65}"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseAttribute VB_TemplateDerived = FalseAttribute VB_Customizable = FalsePrivate Sub CommandButton1_Click() Me.HideEnd Sub

Private Sub UserForm_Click()

End Sub

Private Sub UserForm_Initialize() TextBox1.Text = Range("Dulieu!B29") End Sub

Attribute VB_Name = "UserForm2"Attribute VB_Base = "0{32165FD6-A7B1-473E-BD65-8DA1D28A1056}{CAA93FF1-F957-441F-97D5-A7975A932AB3}"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseAttribute VB_TemplateDerived = FalseAttribute VB_Customizable = False

Private Sub CommandButton1_Click() Me.HideEnd Sub

Attribute VB_Name = "Sheet3"Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = TrueAttribute VB_TemplateDerived = FalseAttribute VB_Customizable = TrueAttribute VB_Control = "cmdBack, 1, 0, MSForms, CommandButton"Private Sub cmdBack_Click() Worksheets("Tinh tuoi").ActivateEnd Sub