程式放在excel內
我想請問一下
如果我想要出現的結果是
在A1輸入2007/11/23
B2輸入ChineCalender(A1)
結果會出現十月十四日小雪
但是現在我想要出現的結果是
如果遇到農曆每月初一時~就只出現那一個月份(如十月)
其餘的日子就出現十四 小雪
以上這樣的結果
不曉得要如何修改呢?
Dim IntToSimDay__$(31, 4)
Public rgstrMonthName(11) As String
Public rgstrDayName(6) As String
Public rgiDaysInMonth(11) As String
Dim B__1__$(11)
Dim B__2__(220)
Dim B__3__(410)
Dim B__4__$(30)
Dim B__5__$(12)
Dim B__6__$(12)
Dim B__7__$(23)
Dim iYear
Dim iMonth
Dim iDay
'IntToSimDay__$(, 0)'天干地支年
'IntToSimDay__$(, 1)'十二生肖年
'IntToSimDay__$(, 2)'農曆月
'IntToSimDay__$(, 3)'農曆日
'IntToSimDay__$(, 4)པ節氣
Function ChineCalender(iDate)
Dim iYear As Integer, iMonth As Integer, iDay As Integer
If IsDate(iDate) Then
iYear = Year(iDate)
iMonth = Month(iDate)
iDay = Day(iDate)
Call IniLunarStr
GetLunarDays iYear, iMonth
Intyear = "民國" & Application.WorksheetFunction.Text(iYear - 1911, ";@") & "年"
ChineCalender = IntToSimDay__$(iDay - 1, 2) _
& IntToSimDay__$(iDay - 1, 3) & IntToSimDay__$(iDay, 4)
Else
ChineCalender = ""
End If
End Function
Function ChineCalenderA(iDate)
Dim iYear As Integer, iMonth As Integer, iDay As Integer
If IsDate(iDate) Then
iYear = Year(iDate)
iMonth = Month(iDate)
iDay = Day(iDate)
Call IniLunarStr
GetLunarDays iYear, iMonth
Intyear = "民國" & Application.WorksheetFunction.Text(iYear - 1911, ";@") & "年"
ChineCalenderA = IntToSimDay__$(iDay - 1, 0) & IntToSimDay__$(iDay - 1, 1)
Else
ChineCalenderA = ""
End If
End Function
Private Sub IniLunarStr()
Dim i
rgstrMonthName(0) = "一月"
rgstrMonthName(1) = "二月"
rgstrMonthName(2) = "三月"
rgstrMonthName(3) = "四月"
rgstrMonthName(4) = "五月"
rgstrMonthName(5) = "六月"
rgstrMonthName(6) = "七月"
rgstrMonthName(7) = "八月"
rgstrMonthName(8) = "九月"
rgstrMonthName(9) = "十月"
rgstrMonthName(10) = "十一月"
rgstrMonthName(11) = "十二月"
B__2__(0) = 30 ཇ
B__2__(1) = 29 1994 (農曆月份最後一天)
B__2__(2) = 30 Ƈ
B__2__(3) = 30 ƈ
B__2__(4) = 30 Ɖ
B__2__(5) = 29 Ɗ
B__2__(6) = 30 Ƌ
B__2__(7) = 29 ƌ
B__2__(8) = 30 ƍ
B__2__(9) = 29 Ǝ
B__2__(10) = 29 Ə
B__2__(11) = 30 ཆ
B__2__(12) = 29 ཇ
B__2__(13) = 30 1995
B__2__(14) = 29 Ƈ
B__2__(15) = 30 ƈ
B__2__(16) = 30 Ɖ
B__2__(17) = 29 Ɗ
B__2__(18) = 30 Ƌ
B__2__(19) = 29 ƌ
B__2__(20) = 30 ƍ
B__2__(21) = 30 Ǝ
B__2__(22) = 39 'r8
B__2__(23) = 29 Ə
B__2__(24) = 30 ཆ
B__2__(25) = 29 ཇ
B__2__(26) = 30 1996
B__2__(27) = 29 Ƈ
B__2__(28) = 30 ƈ
B__2__(29) = 29 Ɖ
B__2__(30) = 30 Ɗ
B__2__(31) = 30 Ƌ
B__2__(32) = 29 ƌ
B__2__(33) = 30 ƍ
B__2__(34) = 29 Ǝ
B__2__(35) = 30 Ə
B__2__(36) = 30 ཆ
B__2__(37) = 29 ཇ
B__2__(38) = 29 1997
B__2__(39) = 30 Ƈ
B__2__(40) = 29 ƈ
B__2__(41) = 30 Ɖ
B__2__(42) = 29 Ɗ
B__2__(43) = 30 Ƌ
B__2__(44) = 29 ƌ
B__2__(45) = 30 ƍ
B__2__(46) = 30 Ǝ
B__2__(47) = 29 Ə
B__2__(48) = 30 ཆ
B__2__(49) = 30 ཇ
B__2__(50) = 29 1998
B__2__(51) = 30 Ƈ
B__2__(52) = 29 ƈ
B__2__(53) = 29 Ɖ
B__2__(54) = 30 Ɗ
B__2__(55) = 29 Ƌ
B__2__(56) = 39 'r5
B__2__(57) = 30 ƌ
B__2__(58) = 30 ƍ
B__2__(59) = 29 Ǝ
B__2__(60) = 30 Ə
B__2__(61) = 30 ཆ
B__2__(62) = 29 ཇ
B__2__(63) = 30 1999
B__2__(64) = 30 Ƈ
B__2__(65) = 29 ƈ
B__2__(66) = 29 Ɖ
B__2__(67) = 30 Ɗ
B__2__(68) = 29 Ƌ
B__2__(69) = 29 ƌ
B__2__(70) = 30 ƍ
B__2__(71) = 29 Ǝ
B__2__(72) = 30 Ə
B__2__(73) = 30 ཆ
B__2__(74) = 30 ཇ
B__2__(75) = 29 2000
B__2__(76) = 30 Ƈ
B__2__(77) = 30 ƈ
B__2__(78) = 29 Ɖ
B__2__(79) = 29 Ɗ
B__2__(80) = 30 Ƌ
B__2__(81) = 29 ƌ
B__2__(82) = 29 ƍ
B__2__(83) = 30 Ǝ
B__2__(84) = 29 Ə
B__2__(85) = 30 ཆ
B__2__(86) = 30 ཇ
B__2__(87) = 29 2001
B__2__(88) = 30 Ƈ
B__2__(89) = 30 ƈ
B__2__(90) = 29 Ɖ
B__2__(91) = 30 Ɗ
B__2__(92) = 39 'r4
B__2__(93) = 30 Ƌ
B__2__(94) = 29 ƌ
B__2__(95) = 29 ƍ
B__2__(96) = 30 Ǝ
B__2__(97) = 29 Ə
B__2__(98) = 30 ཆ
B__2__(99) = 29 ཇ
B__2__(100) = 30 2002
B__2__(101) = 30 Ƈ
B__2__(102) = 30 ƈ
B__2__(103) = 29 Ɖ
B__2__(104) = 30 Ɗ
B__2__(105) = 29 Ƌ
B__2__(106) = 30 ƌ
B__2__(107) = 29 ƍ
B__2__(108) = 29 Ǝ
B__2__(109) = 30 Ə
B__2__(110) = 29 ཆ
B__2__(111) = 30 ཇ
B__2__(112) = 29 2003
B__2__(113) = 30 Ƈ
B__2__(114) = 30 ƈ
B__2__(115) = 29 Ɖ
B__2__(116) = 30 Ɗ
B__2__(117) = 30 Ƌ
B__2__(118) = 29 ƌ
B__2__(119) = 30 ƍ
B__2__(120) = 29 Ǝ
B__2__(121) = 29 Ə
B__2__(122) = 30 ཆ
B__2__(123) = 29 ཇ
B__2__(124) = 30 2004
B__2__(125) = 29 Ƈ
B__2__(126) = 30 ƈ
B__2__(127) = 39 'r2
B__2__(128) = 30 Ɖ
B__2__(129) = 30 Ɗ
B__2__(130) = 29 Ƌ
B__2__(131) = 30 ƌ
B__2__(132) = 29 ƍ
B__2__(133) = 30 Ǝ
B__2__(134) = 29 Ə
B__2__(135) = 30 ཆ
B__2__(136) = 29 ཇ
B__2__(137) = 30 2005
B__2__(138) = 29 Ƈ 2005
B__2__(139) = 30 ƈ 2005
B__2__(140) = 29 Ɖ 2005
B__2__(141) = 30 Ɗ 2005
B__2__(142) = 29 Ƌ 2005
B__2__(143) = 30 ƌ 2005
B__2__(144) = 30 ƍ 2005
B__2__(145) = 29 Ǝ 2005
B__2__(146) = 30 Ə 2005
B__2__(147) = 29 ཆ 2005
B__2__(148) = 30 ཇ 2005
B__2__(149) = 29 2006
B__2__(150) = 30 Ƈ 2006
B__2__(151) = 29 ƈ 2006
B__2__(152) = 30 Ɖ 2006
B__2__(153) = 29 Ɗ 2006
B__2__(154) = 30 Ƌ 2006
B__2__(155) = 29 ƌ 2006
B__2__(156) = 30 ƍ 2006
B__2__(157) = 39 ƍ 2006 r2
B__2__(158) = 30 Ǝ 2006
B__2__(159) = 30 Ə 2006
B__2__(160) = 29 ཆ 2006
B__2__(161) = 30 ཇ 2006
B__2__(162) = 30 2006
B__2__(163) = 29 Ƈ 2007
B__2__(164) = 29 ƈ 2007
B__2__(165) = 30 Ɖ 2007
B__2__(166) = 29 Ɗ 2007
B__2__(167) = 29 Ƌ 2007
B__2__(168) = 30 ƌ 2007
B__2__(169) = 29 ƍ 2007
B__2__(170) = 30 Ǝ 2007
B__2__(171) = 30 Ə 2007
B__2__(172) = 30 ཆ 2007
B__2__(173) = 29 ཇ 2007
B__2__(174) = 30 2007
B__2__(175) = 30 Ƈ 2008
B__2__(176) = 29 ƈ 2008
B__2__(177) = 29 Ɖ 2008
B__2__(178) = 30 Ɗ 2008
B__2__(179) = 29 Ƌ 2008
B__2__(180) = 29 ƌ 2008
B__2__(181) = 30 ƍ 2008
B__2__(182) = 29 Ǝ 2008
B__2__(183) = 30 Ə 2008
B__2__(184) = 30 ཆ 2008
B__2__(185) = 29 ཇ 2008
B__2__(186) = 30 2008
B__2__(187) = 30 Ƈ 2009
B__2__(188) = 30 ƈ 2009
B__2__(189) = 29 Ɖ 2009
B__2__(190) = 29 Ɗ 2009
B__2__(191) = 30 Ƌ 2009
B__2__(192) = 39 'r5 2009
B__2__(193) = 29 ƌ 2009
B__2__(194) = 30 ƍ 2009
B__2__(195) = 29 Ǝ 2009
B__2__(196) = 30 Ə 2009
B__2__(197) = 29 ཆ 2009
B__2__(198) = 30 ཇ 2009
B__2__(199) = 30 2009
B__2__(200) = 30 Ƈ 2010
B__2__(201) = 29 ƈ 2010
B__2__(202) = 30 Ɖ 2010
B__2__(203) = 29 Ɗ 2010
B__2__(204) = 30 Ƌ 2010
B__2__(205) = 29 ƌ 2010
B__2__(206) = 29 ƍ 2010
B__2__(207) = 30 Ǝ 2010
B__2__(208) = 29 Ə 2010
B__2__(209) = 29 ཆ 2010
B__2__(210) = 30 ཇ 2010
B__2__(211) = 30 2010
B__3__(0) = 5
B__3__(1) = 20
B__3__(2) = 4
B__3__(3) = 19
B__3__(4) = 6
B__3__(5) = 21
B__3__(6) ..
訪客只能看到部份內容,免費 加入會員 或由臉書 Google 可以看到全部內容