Consulting

Results 1 to 2 of 2

Thread: Solved: division with zero

  1. #1
    VBAX Regular
    Joined
    Apr 2011
    Posts
    43
    Location

    Solved: division with zero

    HI,

    i need help with something... I need to divide all zeros in column with 1000000000, so that i get something like 0,0000001.

    Cells(2, m).FormulaR1C1 = "=IF(RC[-28]=0,RC[-28]/1000000,RC[-28])"

    this is what i have, but the zeros remain like 0,00, and if i increase the number of decimal places, it is still zero.

    Does excel vba automaticall round numbers and how do I avoid that, because i need the 0,0000001 number.

    Thanks in advance!

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Dividing zero by anything will always be zero. Why would you expect anything else?
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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