last day (14 days later) » 

10:35 AM
0
A: Error while using lookup function

MrigInstead of Sheets("ThisWeek").Range("M2:M" & tr).Formula = Application.WorksheetFunction.IfError(Application.VLookup(Sheets("ThisWeek").Range("A2:A" & trsh), Sheets("LastWeek").Range("$A:$P"), 13, 0), "") try Dim cel as Range For Each cel In Sheets("ThisWeek").Range("M2:M" & tr) cel.Offs...

 
@Jenny - I've updated formula in my answer, initially I wrote wrong one.
 
The result I expected is correct, but now all my data in column N disappeared, why is that so ?
 
@Jenny - As per the screen shot you attached, I thought for values in Column M you want result in Column N
@Jenny - In which column you want results to be displayed?
@Jenny - And which column has data? I'll give you exact formula.
 
Sorry Mrig for the confusion. I want my result in Column M
Fine, I have my data in sheet1 in column M and I want the Vlookup data to be in sheet2 of column M
 
@Jenny - See edited code.
 
10:35 AM
the last suggested code, worked fine. This code is producing the same result as mine. With the last code, it was just an issue that, it deleted my column N
 
@Jenny - Updated code should work fine. I've tested it. Please confirm that you ID's in both sheet are in Column A and values are in Column M of sheet LastWeek and same has to be displayed in Column M of ThisWeek
 
My ID are in column A in both the Sheets. and the values are in column M of both the Sheets. I dont know due to some reason in my rows of 55 to 61, i get it printed as 0
 
@Jenny - I've added images to show this solution works fine. Is it possible for you to share your file with sample data probably leaving row 55 to 61 as it is.
 
I cant share the data. I will try to work on it. Thank you that you helped me so much .
 
If your problem is not solved there's no point in accepting solution as answer.
Allright,you said my first solution worked for you
 
10:36 AM
No , this Solution is working with new sheet. There was some Problem with my data.
 
ok
no problem then
 
This is working fine and thats why I acceped it as answer :)
 
Alright.
 
Thank you Mrig for your Support and giving me an simpler code I could understand
 
You are welcome.
 

last day (14 days later) »