|
本帖最后由 重庆思豆 于 2018-9-13 11:52 编辑
Sub 部门日报相关() '部门日报相关
Dim i As Integer
Dim j As Variant
Dim n As Integer
Dim m As Integer
Dim n1 As Integer
Dim m1 As Integer
Dim c As Integer
Dim c1 As Integer
Dim s As Variant
Dim s1 As Single
Dim ss As Single
Dim ss1 As Single
'Dim su As Integer
'Dim su1 As Integer
'Dim sum1 As Integer
With Intersect(ActiveSheet.UsedRange, [f:g])
.NumberFormatLocal = "G/通用格式"
.Value = .Value
End With
j = Range("A58000").End(xlUp).Row '非空行数
For i = 2 To j
If Application.Text(Application.TODAY() - 1, YYYY / MM / DD) = Application.Text("2018/" & Month(Range("T" & i)) & "/" & Day(Range("T" & i)), YYYY / MM / DD) Then
s = Range("F" & i).Value + s '商业保费
MsgBox "2018保单笔数" & s
End If
问题1:j = Range("A58000").End(xlUp).Row '非空行数 这里 A58000 如果改为大于A58000 就会提示"溢出"
问题2:希望实现 将"T"列 中 日期为前一天的记录找出 ,然后对F列求和 但是 If Application.Text(Application.TODAY() - 1, YYYY / MM / DD) = Application.Text("2018/" & Month(Range("T" & i)) & "/" & Day(Range("T" & i)), YYYY / MM / DD) Then 这样表达却不成功 请帮助
|
|