|
Sub 查询_单击()
Dim d
Dim c
Application.ScreenUpdating = False
With Sheets("凭证查询打印")
s1 = Range("d3").Value '月
s2 = Range("g3").Value '编号
d = 6
c = .Range("a5")
If IsError(c) = True Then
MsgBox "月份错误"
Application.ScreenUpdating = True
End
End If
'Sheets("记账数据库").Range("a:z").Sort
Do While Sheets("记账数据库").Cells(c, 1).Value = Range("d3").Value _
And Sheets("记账数据库").Cells(c, 3).Value = Range("g3").Value _
And Sheets("记账数据库").Cells(c, 3).Value <> "" And d < 12
If Sheets("记账数据库").Cells(c, 1).Value = sl _
And Sheets("记账数据库").Cells(c, 3).Value = s2 Then
.Cells(d, 2).Value = Sheets("记账数据库").Cells(c, 6).Value
.Cells(d, 3).Value = Sheets("记账数据库").Cells(c, 9).Value
' .Cells(d, 5).Value = Sheets("记账数据库").Cells(c, 10).Value
' .Cells(d, 6).Value = Sheets("记账数据库").Cells(c, 11).Value
' .Cells(d, 7).Value = Sheets("记账数据库").Cells(c, 13).Value
'.Cells(d, 8).Value = Sheets("记账数据库").Cells(c, 14).Value
d = d + 1
c = c + 1
Else
c = c + 1
End If
Loop
End With
Application.ScreenUpdating = True
End Sub
|
|