Vlookup然后复制

时间:2018-10-17 20:47:18

标签: excel vba

我正在尝试使用vlookup在一张工作表中查找一个值,将该值分配给一个变量,然后将其复制到另一张工作表中。

对于Vlookup,我正在尝试查找POM&VENT的值以将其查找为Value1Value3。

我收到一条错误消息,告诉我需要对象。

Dim LookRangeT1 As Range

LookupRangeT1 = Sheets("T-1").Range("A20:S700")

Dim POM As String
POM = "Value1"

Dim VENT As String
VENT = "Value3"

Dim LookRangeT1 As Range
LookupRangeT1 = Sheets("T-1").Range("A20:S700")

Dim LookupCOT As Integer
LookupCOT = 16

Dim LookupCMP As Integer
LookupCMP = 17

Dim LookupRDI As Integer
LookupRDI = 18

Dim LookupCOF As Integer
LookupCOF = 19

Dim vResult As Integer
ExactMatch = False

Set vResult = Application.WorksheetFunction.VLookup((POM) & (VENT), 
LookupRangeT1, LookupCMP, ExactMatch)
vResult.Copy
Sheets("Endur T1").Activate
Range("O2").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
Application.CutCopyMode = False

0 个答案:

没有答案