資源描述:
《農(nóng)歷轉(zhuǎn)換加載宏.xls》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。
1、農(nóng)歷轉(zhuǎn)換加載宏.xls'2003/6/30ModifyByligbin'日期數(shù)據(jù)定義方法如下'前12個(gè)字節(jié)代表1-12月為大月或是小月,1為大月30天,0為小月29天,'第13位為閏月的情況,1為大月30天,0為小月29天,第14位為閏月的月'份,如果不是閏月為0,否則給出月份,10、11、12分別用A、B、C來表'示,即使用16進(jìn)制。最后4位為當(dāng)年家農(nóng)歷新年-即農(nóng)歷1月1日所在公歷'的日期,如0131代表1月31日。是按照加入閏月后順序計(jì)算大小月,12月即臘月不計(jì)算,因?yàn)槭亲詈笠粋€(gè)月,到下一年又是一個(gè)計(jì)算基數(shù)。Functionnlgl(valdateAsDate,OptionalIsG
2、etGlAsBoolean)tYear=Year(valdate)tMonth=Month(valdate)tDay=Day(valdate)OnErrorResumeNextDimdaList(1900To2011)AsString*18DimconDateAsDate,setDateAsDateDimAddMonthAsInteger,AddDayAsInteger,AddYearAsInteger,getDayAsIntegerDimRunYueAsBooleanIftYear>2010OrtYear<1900ThenGoToyyyy:IftYear<1900ThentYear=t
3、Year+19*Int((1942-tYear)/19)ElseIftYear>2010ThentYear=tYear-19*Int((tYear-1942)/19)EndIfEndIf'如IFTHEVALDATENOTINCASE,THENTRANSITIONTHENVALDATE'1900to2011daList(1900)="010010110110080131"'原為daList(1900)="010010110110180131"daList(1901)="010010101110000219"daList(1902)="101001010111000208"daList(19
4、03)="010100100110050129"'原為daList(1903)="010100100110150129"daList(1904)="110100100110000216"daList(1905)="110110010101000204"daList(1906)="011010101010140125"daList(1907)="010101101010000213"daList(1908)="100110101101000202"daList(1909)="010010101110020122"'daList(1909)="010010101110120122"daLis
5、t(1910)="010010101110000210"daList(1911)="101001001100060130"'daList(1911)="101001001101160130"daList(1912)="101001001101000218"daList(1913)="110100100101000206"daList(1914)="110101010100150126"daList(1915)="101101010101000214"daList(1916)="010101101010000204"daList(1917)="100101101101020123"daLi
6、st(1918)="100101011011000211"daList(1919)="010010011011170201"daList(1920)="010010011011000220"daList(1921)="101001001011000208"daList(1922)="101100100101050128"'daList(1922)="101100100101150128"daList(1923)="011010100101000216"daList(1924)="011011010100000205"daList(1925)="101011011010140124"daL
7、ist(1926)="001010110110000213"daList(1927)="100101010111000202"daList(1928)="010010010111020123"'daList(1928)="010010010111120123"daList(1929)="010010010111000210"daList(1930)="011001001011060130"daList(1931)="11010100