51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1968|回复: 0
打印 上一主题 下一主题

[原创] leal2012

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2013-7-22 21:12:30 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
Private Sub Report_Click()
    Dim input_report As String
    Dim long_input As Long
    Dim serrial_project As Integer: serrial_project = 0
   
    If Date_Month.Text = "" Then
        MsgBox "Please input Report Date !"
        End
    End If
    input_report = Date_Month.Text
    long_input = CLng(CDate(input_report))   'change date to long
   
    While (Sheets("Month").Cells(serrial_project + 5, 3).Value <> "")
        Call each_project(serrial_project, long_input)
        serrial_project = serrial_project + 1
    Wend
   
End Sub

'
Private Function each_project(a, b)
    Dim j, k As Integer:  k = 0
    Dim sourch_report As String
    Dim p1, p2 As Integer
    Dim q1, q2 As String
    Dim long_source As Long
    Dim sum_ports As Integer: sum_ports = 0
   
    For j = 1 To Sheets.Count
        If UCase(Sheets(j).Name) = UCase(Sheets("month").Cells(a + 5, 3).Value) Then
            While (UCase(Sheets(j).Cells(4 + k, 13).Value) <> "")
                If (UCase(Sheets(j).Cells(4 + k, 13).Value) = "YES") Then
                    sourch_report = Sheets(j).Cells(4 + k, 10).Value
                    p1 = InStr(sourch_report, "/")
                    p2 = InStrRev(sourch_report, "/")
                    q1 = Left(sourch_report, p1 - 1)
                    q2 = Right(sourch_report, Len(sourch_report) - p2)
                    long_source = CLng(CDate(q1 & "/" & q2))
                    If long_source = b Then
                        sum_ports = sum_ports + Val(Sheets(j).Cells(4 + k, 11).Value)
                    End If
                End If
                k = k + 1
            Wend
            Sheets("month").Cells(a + 5, 5).Value = sum_ports
            sum_ports = 0: k = 0
            Exit For
        End If
    Next j
End Function

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-9-22 19:45 , Processed in 0.070456 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表