Results 1 to 2 of 2

Thread: [RESOLVED] Populating a Excel cell with a formula

  1. #1

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Resolved [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


    thx
    toe

    edit
    i thought this was a VB question
    the button i speak of is a .net button....
    Last edited by toecutter; Jul 8th, 2015 at 11:24 PM. Reason: post moved to office

  2. #2

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Re: [RESOLVED] Populating a Excel cell with a formula

    i just put a 0 in the pricing sheet and all seems good
    thx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width