+ Reply to Thread
Results 1 to 2 of 2

If Then Else statement using decimals

  1. #1
    Registered User
    Join Date
    07-30-2019
    Location
    France
    MS-Off Ver
    365 ProPlus
    Posts
    3

    If Then Else statement using decimals

    Hello!

    I want to use a different ComboBox depending on the value the user introduces, the problem is that if the user introduces a value with a point in it (1.1), it takes it as 11. If I use commas it is fine but I want the user to be able to introduce either points or commas


    Please Login or Register  to view this content.


    Thank you!
    Last edited by AliGW; 08-06-2019 at 03:37 AM. Reason: Code tags corrected.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: If Then Else statement using decimals

    You've shown only the code no file, so it's not so obvious, but I'd assume SI is a textbox, so it contains a text (string). VBA tries to convert it to double when you compare it to double, but from your description it sounds that it fails due to whong treatment of non-standard decimals separator.
    Let's try:

    Please Login or Register  to view this content.
    Best Regards,

    Kaper

+ 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] IF with Decimals
    By proj1205 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-13-2017, 02:37 AM
  2. CF with decimals and other
    By BoudeyCall in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-15-2017, 10:04 AM
  3. Rounding 2 decimals to specific 2 decimals
    By danyel191 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-28-2016, 01:41 PM
  4. Replies: 2
    Last Post: 02-13-2015, 07:36 AM
  5. if-statement regarding decimals
    By Mikaelul in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-04-2007, 04:01 PM
  6. rounding decimals in an IF statement
    By static69 in forum Excel General
    Replies: 1
    Last Post: 05-04-2005, 09:20 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