Dim date1 As Date Dim date2 As Date Dim diffdays As Long Dim count, i As Long Dim publishdate As Long date1 = "2003-2-2" date2 = "2003-3-30" publishdate = 31 count = 0 diffdays = DateDiff("d", date1, date2) For i = 0 To diffdays If publishdate <= 28 Then If Day(date1 + i) = publishdate Then count = count + 1 End If Else If Day(date1 + i) = 1 Or Day(date1 + i) = publishdate Then count = count + 1 End If End If Next i If publishdate > 28 And Day(date1) = 1 Then MsgBox count - 1 Else MsgBox count End If
如从一月份开始,现在是9月19号,那么前面就有了八个月的完整发行,
2*8=16,然后就当前的日期进行判断,如果date>15 那么就是第18期了,否则为17期。
不知道行不行?
DaysInAMonth 应该是你最需要的 其他自己做吧
Dim date2 As Date
Dim diffdays As Long
Dim count, i As Long
Dim publishdate As Long
date1 = "2003-2-2"
date2 = "2003-3-30"
publishdate = 31
count = 0
diffdays = DateDiff("d", date1, date2)
For i = 0 To diffdays
If publishdate <= 28 Then
If Day(date1 + i) = publishdate Then
count = count + 1
End If
Else
If Day(date1 + i) = 1 Or Day(date1 + i) = publishdate Then
count = count + 1
End If
End If
Next i
If publishdate > 28 And Day(date1) = 1 Then
MsgBox count - 1
Else
MsgBox count
End If
楼主: 本软件是我在业余时间完成,我的目标是将它做成国内一流的客户端邮件软件.现在初具模型.正在修改中.它有一下特点:
1. 基于SDK模式开发
2. 大量源代码:软件中用到的所有组件,包括每一个按钮,均是自己所写.形成了自己风格的完整的一套组件库.他们包括:列表,文件管理,菜单等
所有代码均参照标准协议写成3. 由以下功能模块组成:邮件;新闻组;FTP;任务及其在之基础上的相应管理.如文件管理等.
4. 合作方式:转让经营权;根据你们需要提供技术支持;作为贵公司产品发布等我的联系方式是:[email protected] 13062323245 运行演示图:
http://bbs.2ccc.com/uploads/huangtao/picture.jpg
安装盘下:ftp://[email protected]/SmartMail_Setup.rar
代码下:ftp://[email protected]/SmartMail_Code.rar
ftp密码:uploads
建议大家先下安装盘,因为比较新,支持皮肤改变,自己定义哦