itipu
06-17-2007, 11:21 PM
Gents, you helped me yesterday with Vlookup formula, unfortunately I can not seem to get it working any more... I attached a workbook again.
I have a sheet called Table in that workbook, and basically I need to get some values out of it using vlookup...
the issues are here...
'Get length of RecordSet
columnLength = 'Length of Column D...
'For Column A Get Sales Organization out of the Table
ActiveSheet.Range("A2:A$" & columnLength).Formula = _
"=IF(ISERROR(VLOOKUP(D1,Sheet7!$A:$B,2,FALSE)),""0"", VLOOKUP(D1,Sheet7!$A:$B,2,FALSE))"
'For Column E Get Plant out of the Table
ActiveSheet.Range("A2:A$" & columnLength).Formula = _
"=IF(ISERROR(VLOOKUP(D1,Sheet7!$A:$B,2,FALSE)),""0"", VLOOKUP(D1,Sheet7!$A:$B,2,FALSE))"
'For Column L Get Currency out of the Table
ActiveSheet.Range("A2:A$" & columnLength).Formula = _
"=IF(ISERROR(VLOOKUP(D1,Sheet7!$A:$B,2,FALSE)),""0"", VLOOKUP(D1,Sheet7!$A:$B,2,FALSE))"
Don't get anything... also can't seem to get columnLength to the length of Column D...
Sample of what I got is included...
I know my VBA skills are a nightmare.. but I am trying to learn :)
Thanks a lot again!!!!
Mike
I have a sheet called Table in that workbook, and basically I need to get some values out of it using vlookup...
the issues are here...
'Get length of RecordSet
columnLength = 'Length of Column D...
'For Column A Get Sales Organization out of the Table
ActiveSheet.Range("A2:A$" & columnLength).Formula = _
"=IF(ISERROR(VLOOKUP(D1,Sheet7!$A:$B,2,FALSE)),""0"", VLOOKUP(D1,Sheet7!$A:$B,2,FALSE))"
'For Column E Get Plant out of the Table
ActiveSheet.Range("A2:A$" & columnLength).Formula = _
"=IF(ISERROR(VLOOKUP(D1,Sheet7!$A:$B,2,FALSE)),""0"", VLOOKUP(D1,Sheet7!$A:$B,2,FALSE))"
'For Column L Get Currency out of the Table
ActiveSheet.Range("A2:A$" & columnLength).Formula = _
"=IF(ISERROR(VLOOKUP(D1,Sheet7!$A:$B,2,FALSE)),""0"", VLOOKUP(D1,Sheet7!$A:$B,2,FALSE))"
Don't get anything... also can't seem to get columnLength to the length of Column D...
Sample of what I got is included...
I know my VBA skills are a nightmare.. but I am trying to learn :)
Thanks a lot again!!!!
Mike