[RESOLVED] Populating a Excel cell with a formula
i use this code behind a VB.net button in a loop to look-up pricing from another workbook and it populates some cells and not other cells in column H with 0 if no look-up is found.
Why is it skipping some cells?
column H
Code:
Dim lLabourCostFormulaToEnter As String = Nothing
lLabourCostFormulaToEnter = "=IF(ISNA(VLOOKUP($B:$B,'" & dDircetory & "[PricingSheet.xls]Pricing'!$A$1:$D$5000,2,FALSE)),0,VLOOKUP($B:$B,'" _
& dDircetory & "[PricingSheet.xls]Pricing'!$A$1:$D$5000,2,FALSE))"
moSheet1.Cells(row, col).Formula = lLabourCostFormulaToEnter
col = col + 1
http://i354.photobucket.com/albums/r...psijehb6is.jpg
thx
toe
edit
i thought this was a VB question
the button i speak of is a .net button....
Re: [RESOLVED] Populating a Excel cell with a formula
i just put a 0 in the pricing sheet and all seems good
thx