MarkB2908
02-26-2021, 05:36 AM
Hi there.
Within a VB procedure i have a very simple calculation i.e. Number 1 divided by Number 2 = Answer.
The results returned always have multiple decimal places i.e. 98.827876.
I would like to pass / insert this value into a Textbox which has been embedded into a Worksheet, but I need it to appear as a % with either 1 or no decimal places.
I've added the % symbol in the simplest that I know i.e. TextboxText = Answer & "%" but the end result shows as 98.827876% (I need to lose some/all of the decimal places)
Is it possible to Round Up the "Answer" to the calculation being performed inside the procedure within VB ?
or
Can I limit the value which is being passed to the embedded textbox so that the end result is simply 98.8% or 99% ?
Hope this makes sense.
Any help would be greatly appreciated.
Within a VB procedure i have a very simple calculation i.e. Number 1 divided by Number 2 = Answer.
The results returned always have multiple decimal places i.e. 98.827876.
I would like to pass / insert this value into a Textbox which has been embedded into a Worksheet, but I need it to appear as a % with either 1 or no decimal places.
I've added the % symbol in the simplest that I know i.e. TextboxText = Answer & "%" but the end result shows as 98.827876% (I need to lose some/all of the decimal places)
Is it possible to Round Up the "Answer" to the calculation being performed inside the procedure within VB ?
or
Can I limit the value which is being passed to the embedded textbox so that the end result is simply 98.8% or 99% ?
Hope this makes sense.
Any help would be greatly appreciated.