|
Sub 取数据()
Dim j, k, b, n, b1, n1
j = Application.WorksheetFunction.CountA(Sheets("流水账").Columns(1))
k = 7
b = Sheets("流水账").Range("A2").Resize(3000)
n = Sheets("总账").Range("C4")
b1 = Sheets("流水账").Range("F2").Resize(3000)
n1 = Sheets("总账").Range("F3")
Sheets("总账").Select
For i = 2 To j
If b = n <> "" And b1 = n1 <> "" Then
If Sheets("流水账").Cells(i, 5) <> "" Then
Do While Cells(k, 1) <> ""
k = k + 1
Loop
Cells(k, 1) = Sheets("流水账").Cells(i, 3)
Cells(k, 2) = Sheets("流水账").Cells(i, 4)
Cells(k, 3) = Sheets("流水账").Cells(i, 5)
Cells(k, 4) = Sheets("流水账").Cells(i, 8)
Cells(k, 6) = "'" & Sheets("流水账").Cells(i, 9)
Cells(k, 12) = "'" & Sheets("流水账").Cells(i, 10)
k = k + 1
End If
End If
Next i
MsgBox "已查到"
End Sub
运行到“ If b = n <> "" And b1 = n1 <> "" Then”时[运行时错误13 类型不匹配]
|
|