rebeccawilson100
New Member
- Joined
- Jun 23, 2016
- Messages
- 7
Hello,
First time poster so bare with me.
I have written a VBA code and am having some issues with a decimal place. Unfortunately i cannot post the code as it is work related.
Essentially I have a value assigned to a Variable A using A=Application.Worksheetfunction.round(B,2). when i hover over the variable it only shows 2dp (which is what i want) but unfortunately when this value is deposited into a Cell later in the code it shows the value to more dp (around 10 or so).
I have used Cells(X,Y)=A to input into the spreadsheet. I checked that the variable isn't reassigned just before assigning to a cell and it still shows 2dp.
After googling i found the format(B,"#.00") but this gave the same end result.
I think the issue may occur when placing the value into a cell as the variable has the correct assigned amount of dp.
Any ideas?
Thanks
First time poster so bare with me.
I have written a VBA code and am having some issues with a decimal place. Unfortunately i cannot post the code as it is work related.
Essentially I have a value assigned to a Variable A using A=Application.Worksheetfunction.round(B,2). when i hover over the variable it only shows 2dp (which is what i want) but unfortunately when this value is deposited into a Cell later in the code it shows the value to more dp (around 10 or so).
I have used Cells(X,Y)=A to input into the spreadsheet. I checked that the variable isn't reassigned just before assigning to a cell and it still shows 2dp.
After googling i found the format(B,"#.00") but this gave the same end result.
I think the issue may occur when placing the value into a cell as the variable has the correct assigned amount of dp.
Any ideas?
Thanks