Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In Excell 2007 I am formating an imported CSV file of credit card
transactions into and existing workbook. I used the foloowing code to place a lookup in column B: Sheets(1).Range("B2").Formula = "=(VLOOKUP(A2,GLCode,2,"")" This works perfectly and further down in the code it is placed in all the cells in B:B to the end of transactions. The problem for me is that A:A in the onset is blank so the lookup returns #NA, whic is expected. But i parse these lines of data out into separate worksheets from Access and email then to each individual cardholder for their input intl column A:A. Outside of VBA I would use IFERROR(Vlookup,"") and be on my way but I cannot get this to work in code. The following code is my unsucessful attempt that gives me an Application-defined or Object-defined Error 1004 halt. I just can't figure where to put Application. at and make I work. Sheets(1).Range("B2").Formula = "=IFERROR(VLOOKUP(A2,GLCode,2,"")" Any suggestions would be helpful --Skip Using Office 2003 Pro 2007 Student version |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this
Sheets(1).Range("B2").Formula = "=IF(ISNA(VLOOKUP(A2,GlCode,2)),"""",VLOOKUP(A2,Gl Code,2))" Mike "Skip Bisconer" wrote: In Excell 2007 I am formating an imported CSV file of credit card transactions into and existing workbook. I used the foloowing code to place a lookup in column B: Sheets(1).Range("B2").Formula = "=(VLOOKUP(A2,GLCode,2,"")" This works perfectly and further down in the code it is placed in all the cells in B:B to the end of transactions. The problem for me is that A:A in the onset is blank so the lookup returns #NA, whic is expected. But i parse these lines of data out into separate worksheets from Access and email then to each individual cardholder for their input intl column A:A. Outside of VBA I would use IFERROR(Vlookup,"") and be on my way but I cannot get this to work in code. The following code is my unsucessful attempt that gives me an Application-defined or Object-defined Error 1004 halt. I just can't figure where to put Application. at and make I work. Sheets(1).Range("B2").Formula = "=IFERROR(VLOOKUP(A2,GLCode,2,"")" Any suggestions would be helpful --Skip Using Office 2003 Pro 2007 Student version |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
vlookup error... | Excel Worksheet Functions | |||
Vlookup #N/A Error | Excel Worksheet Functions | |||
REF# error using VLOOKUP | Excel Worksheet Functions | |||
VLookup N/A Error | Excel Discussion (Misc queries) | |||
#N/A error with VLOOKUP | Excel Discussion (Misc queries) |