Excel VBA 调用vlookup 出错,提示为Object doesn't support this property or method.跪求大神指点 !!
"COSTCENTER"和"Sheet3"是同一个excel表中的两页。非常感谢!!!代码如下Subceshi()J=2DoUntilCells(J,1).Value="...
"COSTCENTER"和"Sheet3"是同一个excel表中的两页。非常感谢!!!
代码如下
Sub ceshi()
J = 2
Do Until Cells(J, 1).Value = " "
Sheets("Sheet3").Cell(J, 1) = Application.WorksheetFunction.VLookup(Sheets("Sheet3").Cell(J, 1), Sheets("COSTCENTER").Range("a2:b72"), 2, 0)
J = J + 1
Loop
End Sub 展开
代码如下
Sub ceshi()
J = 2
Do Until Cells(J, 1).Value = " "
Sheets("Sheet3").Cell(J, 1) = Application.WorksheetFunction.VLookup(Sheets("Sheet3").Cell(J, 1), Sheets("COSTCENTER").Range("a2:b72"), 2, 0)
J = J + 1
Loop
End Sub 展开
2个回答
展开全部
Sub ceshi()
Dim j As Long
j = 2
Do Until Cells(j, 1) = ""
Sheets("Sheet3").Cells(j, 2) = Application.WorksheetFunction.VLookup(Sheets("Sheet3").Cells(j, 1), Sheets("COSTCENTER").Range("a2:b72"), 2, False)
j = j + 1
Loop
End Sub
Dim j As Long
j = 2
Do Until Cells(j, 1) = ""
Sheets("Sheet3").Cells(j, 2) = Application.WorksheetFunction.VLookup(Sheets("Sheet3").Cells(j, 1), Sheets("COSTCENTER").Range("a2:b72"), 2, False)
j = j + 1
Loop
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询