+ Reply to Thread
Results 1 to 4 of 4

decimal value changes when fetched using VBA

  1. #1
    Registered User
    Join Date
    11-20-2012
    Location
    india
    MS-Off Ver
    excel 2010
    Posts
    4

    decimal value changes when fetched using VBA

    Hi Experts,

    I have a situation where i need to fatch a decimal value using VBA.

    In the excel cell, the value is 0.0121066855433171
    But when i fetched using thisworkbook.worksheets("Sheet1").Range("A1").Value , its returning as 1.2335648232275E-03

    This is hampring my task.
    Can any one please tel me how to proceed

    Thanks
    Vijay Bhargav

  2. #2
    Forum Contributor
    Join Date
    10-27-2013
    Location
    Columbus Ohio
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: decimal value changes when fetched using VBA

    Do you have a sample workbook or a sample of your code by chance?

  3. #3
    Registered User
    Join Date
    11-20-2012
    Location
    india
    MS-Off Ver
    excel 2010
    Posts
    4

    Re: decimal value changes when fetched using VBA

    Yes.
    In the sample workbook,

    A1 B1
    0.0121066855433171 0.0012335648232275


    My Code i am trying
    Function test
    beforeVal = ThisWorkbook.Worksheets("Before").Range(cCol & beforeRow).Value
    ''perform some logic
    msgbox beforeVal
    End Function

    in the msgbox, insted of printing 0.0121066855433171 its showing 1.2335648232275E-03.

    I need it exactly because i have to put it in reporting. value should not be changed.


    Thanks In advance

    Vijay

  4. #4
    Forum Contributor
    Join Date
    10-27-2013
    Location
    Columbus Ohio
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: decimal value changes when fetched using VBA

    It is showing 0.0012335648232275 but in exponential notation. What format do you have set on the cell it is being copied into, and a workbook would be great if your able to upload it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Display fetched data in single sheet
    By stoey in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-18-2013, 04:08 PM
  2. [SOLVED] Error in Displaying data fetched from a table
    By basubdd in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-28-2013, 02:47 PM
  3. Formating fetched data from web in VBA
    By devilhack in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-20-2012, 06:09 AM
  4. Data to be fetched from files from folder as per user's selection
    By rohit1985 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-02-2012, 06:00 AM
  5. Replies: 3
    Last Post: 03-18-2006, 02:25 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1