|
Sub 清除sheet8单元格()
'处理“P3计划行号查询”的数据
Sheets("P3收货明细").Select
Dim L, M, N
With Worksheets("P3收货明细")
N = .Application.CountA(Columns(1))
O = .Application.CountA(Rows(1))
Set P3COL = .Cells.Find("订单行号") '在领用明细中找到订单行号所在的列号
If Not P3COL Is Nothing Then
P3c = P3COL.Column '将列号赋值给P3c
End If
Set P3COL1 = .Cells.Find("申请单号码") '在领用明细中找到计划行号所在的列号
If Not P3COL1 Is Nothing Then
P3c1 = P3COL1.Column '将列号赋值给lyco
End If
x = P3c1 - P3c + 1
End With
Sheets("P3计划行号查询").Select
With Worksheets("P3计划行号查询")
L = .Application.CountA(Columns(1)) '总行号
M = .Application.CountA(Rows(1)) '总列数
Set P3Rng = .Cells.Find("订单行号") '在领用明细中找到订单行号所在的列号
If Not P3Rng Is Nothing Then
P3co = P3Rng.Column '将列号赋值给P3co
End If
For i = 1 To L
.Range("a" & i) = WorksheetFunction.VLookup(Cells(i, P3co), Sheets("P3收货明细").Cells(P3c, 1).Resize(N, x), 3, 0)
Next
End With
End Sub
上述语句中,标识绿色的总是提示“不能取得类 worksheetfunction 的 vlookup 属性,不知什么原因?
|
|