PasteSpecial Values without Decimals

hatstand

Well-known Member
Joined
Mar 17, 2005
Messages
778
Office Version
  1. 2016
Platform
  1. Windows
Hi All,

I've been trying but failing to copy a range of values with random length decimal places and paste special, whilst rounding the values. Is it possible or does each value need to be done separately.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I would put a formula in an adescent column that does the rounding.
Then copy/pastespecial that column.

=ROUND(A1,0)
 
Upvote 0
Thanks for the replies. The format works perfect. How the hell I didn't use it already. I put it down to being friday.
 
Upvote 0
you could also just paste all the values, then highlight the range and set the format of the numbers to be with 0,1,2,X decimals?
 
Upvote 0
I've been toying with your ideas now for an hour (for educational purposes).
Ideally, your activesheet doesn't have an event change macro in its code window.
If not, paste the below code into your sheets code window, and test it out....

Try this ONLY -- On a Backup copy of your file...

Let me know the outcome..

Jim


Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range
Dim i As Long, RngCt As Long
On Error Resume Next
If Application.CutCopyMode = xlCopy Then
Application.EnableEvents = False
Set Rng = Target.Cells
RngCt = Rng.Cells.Count
    For i = 1 To RngCt
        Rng(i) = Int(Rng(i))
    Next i
End If
Application.EnableEvents = True
Application.CutCopyMode = False
On Error GoTo 0
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

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