|
请老师费心修改代码,多谢!
Sub 推荐人汇总()
Application.ScreenUpdating = False
Dim xR As Range
D1 = InputBox("请输出查找起始日期(格式为2014-1-1):", "请输入起始时间")
If VBA.IsDate(D1) Then
Else
MsgBox "输入起始日期格式不正确"
Exit Sub
End If
D2 = InputBox("请输出查找终止日期(格式为2014-1-1):", "请输入终止时间")
If VBA.IsDate(D2) Then
Else
MsgBox "输入终止日期格式不正确"
Exit Sub
End If
Sheets("会员缴费查询").Select
Sheets("会员缴费查询").Range("a5:i65536").ClearContents
With Sheets("会员缴费表").Range("$A$3:$I$65536").Cells
.AutoFilter Field:=9, Criteria1:=">=" & D1, Operator:=xlAnd, Criteria2:="<=" & D2
.SpecialCells(xlCellTypeVisible).Copy Sheets("会员缴费查询").Range("a5")
.AutoFilter
End With
Application.ScreenUpdating = True
End Sub
看看
|
|