JannikR13
07-26-2023, 07:58 PM
Good day,
I was trying to subract two values with vba and write it into a specific cell.
Value1 is a Single value with one decimal place from a userform textbox (e.g. 1200.4)
Value2 is a value coming from a formular on a spreadsheet (e.g. H1 + H2 + H3 = 1100.5)
As soon as I subtract Value 2 from Value 1 the outcome is a single with a lot of decimal places like:
1200.6 - 1100.5 = 100.100567
I can't explain myself how I get rid of that weird ending... I already tried to store both Value 1 and 2 as a Single and subtract then...
Till the subtraction the MsgBox for each value is only a one decimal place number as it supposed to be!
Every help is well appreciated. Thank you all!
I was trying to subract two values with vba and write it into a specific cell.
Value1 is a Single value with one decimal place from a userform textbox (e.g. 1200.4)
Value2 is a value coming from a formular on a spreadsheet (e.g. H1 + H2 + H3 = 1100.5)
As soon as I subtract Value 2 from Value 1 the outcome is a single with a lot of decimal places like:
1200.6 - 1100.5 = 100.100567
I can't explain myself how I get rid of that weird ending... I already tried to store both Value 1 and 2 as a Single and subtract then...
Till the subtraction the MsgBox for each value is only a one decimal place number as it supposed to be!
Every help is well appreciated. Thank you all!