I get the error
Method 'Range' of object '_Global' failed
Inwkbk = Macro-Flatten Data 2v2.xlsm
strVlookupsheet = BOQ Map
intRow = 2
intCol = 2
ThisWorkbook.Sheets(strInputSheet).Cells(intRow, intCol + 3) = Application.VLookup(ThisWorkbook.Sheets("2a").Cells(intRow, intCol), Range("'[Inwkbk]strVlookupsheet'!$R$6$C$3", "'[Inwkbk]strVlookupsheet'!$R$1000$C$4"), 2, False)
I am writing a vba to do a vlookup , taking the lookup value from the Vba workbook and range from another workbook . the point here is the workbook and sheet i m taking the value may change . So i have stired them in a string variable and used them in the range .
Method 'Range' of object '_Global' failed
Inwkbk = Macro-Flatten Data 2v2.xlsm
strVlookupsheet = BOQ Map
intRow = 2
intCol = 2
ThisWorkbook.Sheets(strInputSheet).Cells(intRow, intCol + 3) = Application.VLookup(ThisWorkbook.Sheets("2a").Cells(intRow, intCol), Range("'[Inwkbk]strVlookupsheet'!$R$6$C$3", "'[Inwkbk]strVlookupsheet'!$R$1000$C$4"), 2, False)
I am writing a vba to do a vlookup , taking the lookup value from the Vba workbook and range from another workbook . the point here is the workbook and sheet i m taking the value may change . So i have stired them in a string variable and used them in the range .
Last edited: