+ Reply to Thread
Results 1 to 4 of 4

Variable issue: Calculation returns 0, which type to use?

  1. #1
    Registered User
    Join Date
    02-12-2013
    Location
    -
    MS-Off Ver
    -
    Posts
    6

    Question Variable issue: Calculation returns 0, which type to use?

    Hi guys,

    I am calculating something that should result in a value on in the range of 0 to 100.

    Please Login or Register  to view this content.
    Input is a integer between 1 and 5000000.

    Problem: I am always receiving 0 in a test message box.

    Am I using the wrong variable type or doing something wrong?

    Working in VBA in Excel for Mac, v15.33

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Variable issue: Calculation returns 0, which type to use?

    How are you using the function and where is bolDebug declared/set?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    02-12-2013
    Location
    -
    MS-Off Ver
    -
    Posts
    6

    Re: Variable issue: Calculation returns 0, which type to use?

    Hi Norie,

    bolDebug is a boolean for debugging, which is declared in the workbook before this function.
    I managed to get the calculation working.
    By using this secondary step:

    Please Login or Register  to view this content.
    Whereas dec is another double variable.

    Maybe someone else finds this useful or can shed some insight what I am doing wrong in the calculation.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Variable issue: Calculation returns 0, which type to use?

    Without the message box the function seemed to work just fine for me when I used it on a worksheet.

    Where were you using 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. [SOLVED] Function That Returns the Type of Selection
    By centerNegative in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2015, 01:50 PM
  2. [SOLVED] Small Issue with Type Mismatch and Invalid Qualifier when setting variable value from cell
    By TomToms in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2014, 08:03 AM
  3. Input box to needs different type of variable type (RC vs. A1?)
    By Niedermee in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-18-2014, 05:00 PM
  4. Replies: 1
    Last Post: 07-24-2013, 02:45 PM
  5. Replies: 1
    Last Post: 03-28-2012, 10:33 AM
  6. Why VBA returns 3 for xlChart type???
    By Anandi in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-25-2010, 08:25 AM
  7. Replies: 2
    Last Post: 06-20-2005, 10:05 AM

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