广告广告
  加入我的最爱 设为首页 风格修改
首页 首尾
 手机版   订阅   地图  繁体 
您是第 3123 个阅读者
 
发表文章 发表投票 回覆文章
  可列印版   加为IE收藏   收藏主题   上一主题 | 下一主题   
ice-coffee
个人文章 个人相簿 个人日记 个人地图
小人物
级别: 小人物 该用户目前不上站
推文 x7 鲜花 x17
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片
推文 x0
[求助] 农历如何解?
程式放在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 可以看到全部内容




献花 x0 回到顶端 [楼 主] From:台湾 | Posted:2007-12-01 00:39 |

首页  发表文章 发表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.022323 second(s),query:15 Gzip disabled
本站由 瀛睿律师事务所 担任常年法律顾问 | 免责声明 | 本网站已依台湾网站内容分级规定处理 | 连络我们 | 访客留言