D Dinesh_Excel Member Feb 6, 2016 #1 Hi Friends I am trying to implement the excel vlookup function into my vba command. I have a sheet with 2 tabs : Tab 1 = "Base sheet" has 3 columns Tab 2 = "ottwafield" has 2 columns. We have to do a vlookup from Tab 1 to Tab 2 to get the data points from Tab 2. Tab 1 Tab 2 Attachments sample 2.xlsm 50.9 KB · Views: 20
Hi Friends I am trying to implement the excel vlookup function into my vba command. I have a sheet with 2 tabs : Tab 1 = "Base sheet" has 3 columns Tab 2 = "ottwafield" has 2 columns. We have to do a vlookup from Tab 1 to Tab 2 to get the data points from Tab 2. Tab 1 Tab 2
J jindon Well-Known Member Feb 6, 2016 #2 Not sure if this is how you wanted. Code: Sub test() Range("a2", Range("a" & Rows.Count).End(xlUp)).Columns("ae:af").Formula = _ "=iferror(vlookup($a2,ottwafield!$a:$b,column(a1),false),"""")" End Sub
Not sure if this is how you wanted. Code: Sub test() Range("a2", Range("a" & Rows.Count).End(xlUp)).Columns("ae:af").Formula = _ "=iferror(vlookup($a2,ottwafield!$a:$b,column(a1),false),"""")" End Sub
D Dinesh_Excel Member Feb 6, 2016 #3 Thanks Jindon...a very small change, for all the false cases can we get "#NA" instead of Blanks. Thank you for your uncondtional help
Thanks Jindon...a very small change, for all the false cases can we get "#NA" instead of Blanks. Thank you for your uncondtional help
J jindon Well-Known Member Feb 6, 2016 #4 Just delete IfError function.... change Code: "=iferror(vlookup($a2,ottwafield!$a:$b,column(a1),false),"""")" to Code: "=vlookup($a2,ottwafield!$a:$b,column(a1),false)"
Just delete IfError function.... change Code: "=iferror(vlookup($a2,ottwafield!$a:$b,column(a1),false),"""")" to Code: "=vlookup($a2,ottwafield!$a:$b,column(a1),false)"
D Dinesh_Excel Member Feb 6, 2016 #5 Thanks Jindon...its working fine now. Appreciate your help as always. it was very helpful.