----------------------------------------------------------------------------------------------------------------------------
Hi Buddy, Here is your Solution, Try this instead of what you were doing before: *amount = Application.WorkSheetFunction.VLookup (R1C2,[Garnishment_2009_4.xls]Sheet1!R3C1:R100C4,4)* For more tips, tricks, downloads and problem solutions: visit --> http://www.excelitems.com ------------------------------------------------------------------------ Regards *Ashish **Jain* Analyst and Demand-Co-ordinator, CSC Australia Microsoft Certified Application (Excel) Specialist Technical Trainer - Excel and VBA Author -> www.excelitems.com 09999-40-48-43 ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- On Wed, Mar 4, 2009 at 11:50 PM, iwasinnihon <iwasinni...@gmail.com> wrote: > > I am trying to do a vlookup in vba, save the results in a variable and > then place the value in a cell. I used to have the vlookup as a > function for the cell: > > Cells(LastRow, 2).FormulaR1C1 = "=VLOOKUP(R1C2,[Garnishment_2009_4.xls] > Sheet1!R3C1:R100C4,4)" > > However, I don't want it linked, I just want the value saved in the > new file. I tried doing the following and I get a syntax error. > > amount = Application.VLookup(R1C2,[Garnishment_2009_4.xls] > Sheet1!R3C1:R100C4,4) > > What am I doing wrong? > > --~--~---------~--~----~------------~-------~--~----~ > > ------------------------------------------------------------------------------------- > Some important links for excel users: > 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at > http://www.excelitems.com > 2. Excel tutorials at http://www.excel-macros.blogspot.com > 3. Learn VBA Macros at http://www.vbamacros.blogspot.com > 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > > To post to this group, send email to excel-macros@googlegroups.com > If you find any spam message in the group, please send an email to: > Ayush Jain @ jainayus...@gmail.com or > Ashish Jain @ 26may.1...@gmail.com > > ------------------------------------------------------------------------------------- > --~--~---------~--~----~------------~-------~--~----~ ------------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com ------------------------------------------------------------------------------------- -~----------~----~----~----~------~----~------~--~---