How to increase the decimals of output given by VBA?

spgexcel

New Member
Joined
Mar 16, 2016
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a query regarding a VBA output I am getting.
I am using following VBA to calculate some revenues. Pardon my coding skills if they are bad since I am learning using lot of forums and videos.

Code:

Sub revcalc_US()

Application.ScreenUpdating = False

ThisWorkbook.Worksheets("Rev_cal_WIP").Range("US_clr").ClearContents

Dim i As Long
Dim rng As Range
Dim rng1 As Range

For i = 1 To Worksheets("Rev Calc").Range("B10").Value
Set rng = Worksheets("Rev Calc").Range("Newrev")
Set rng1 = Worksheets("Control").Range("X4:Z4").Offset((1 * i) - 1, 0)

Range("rgn").Resize(rng1.Rows.Count, rng1.Columns.Count).Value = rng1.Cells.Value

Range("USrevPaste").Offset((20 * i) - 20, 0).Resize(rng.Rows.Count, rng.Columns.Count).Value = rng.Cells.Value

Next i

Application.ScreenUpdating = True

End Sub



The output I am getting as a result of the orange highlighted code is only till 2 decimals. (Like $ 26.23). I would like it to be till at least 8 decimals.

Can you suggest a tweak in the code or is there anything I am missing to add in the code?

Help is needed and is highly appreciated.

Thanks
Sumant
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
You can use FORMAT to create a text value, which would allow more decimal places. But it is a text value. If you want to save the number as a value, you can save the number as is, but you'd need to change the Number Format of the cell you're putting the value into.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,897
Messages
6,122,141
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top