VBA How to round a value that is copied or a range that is being pasted ?

VytautasM

New Member
Joined
Jan 31, 2020
Messages
33
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
Good day,

Looking for a way to round a value I am trying to copy or the range I am trying to paste.

The code is below. Tried inserting
VBA Code:
Round.
, but do not seem to find the correct placement. Also tried
VBA Code:
numberFormat = "0.0"
.

Could round the whole column after pasting in the values, but would like something a bit more streamlined and accurate.

Any suggestion on how to implement rounding ?


VBA Code:
                wsinput.range("N" & fr + 1).copy
                If wsoutput.range("C" & lroutput + 2).End(xlDown).Row = 1048576 Then
                   wsoutput.range("AE" & lroutput + 1 & ":" & "AE" & lroutput + 2).PasteSpecial paste:=xlPasteValues
                   wsoutput.range("V" & lroutput + 1 & ":" & "V" & lroutput + 2).Value = "=IFERROR(RC[5]*(1-RC[9]),"""")"
                Else
                   wsoutput.range("AE" & lroutput + 1 & ":" & "AE" & wsoutput.range("C" & lroutput + 2).End(xlDown).Row).PasteSpecial paste:=xlPasteValues
                   wsoutput.range("V" & lroutput + 1 & ":" & "V" & wsoutput.range("C" & lroutput + 2).End(xlDown).Row).Value = "=IFERROR(RC[5]*(1-RC[9]),"""")"
                End If
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,214,400
Messages
6,119,288
Members
448,885
Latest member
LokiSonic

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