Namrata Prashar
hi,
i modified the code as below but it gives the following error ..
run time error 1004
unable to get the vlookup property of the worksheet function class
my new code looks something like this.
**************************************************************************
Sub VlookUp_Click()
Dim LookupValue As Range
Dim TableArray As Range
Dim ColIndex As Integer
Dim RangeLookup As Boolean
Dim MyPath As String
MyPath = "C:\Documents and Settings\np22331\Desktop\Consolidated list of supplier.xls"
Workbooks.Open Filename:=MyPath, UpdateLinks:=0, ReadOnly:=True
Set TableArray = Workbooks("Consolidated list of supplier.xls").Worksheets("Sheet3").Range("$A$5:$F$281")
ActiveWorkbook.Close SaveChanges:=False
Set LookupValue = Sheet3.Range("O2")
RangeLookup = False
ColIndex = 6
Sheet3.Cells(2, 16) = Application.WorksheetFunction.VLookup(LookupValue, TableArray, RangeLookup, ColIndex)
End Sub
**************************************************************************************
can somebody please help me with fixing the bug !!
thanks
namrata