Formatting a copied number

ChuckDrago

Active Member
Joined
Sep 7, 2007
Messages
470
Office Version
  1. 2010
Platform
  1. Windows
Hi everyone... a quick question:

Given this line of code

Range("AF" & x + 2).Copy
Worksheets("Transfer").Range("G" & controw).PasteSpecial xlPasteValues

What do I have to add, in order to have the pasted value formated without decimals?

The copy from range value is 3.333333, although formatted as Number, "0". However, when copied over, despite Excel diplaying just a 3, the label program I am using to read the copied over value delivers the entire 3.333333 number, and I want just a 3.

Thanks a bunch

Chuck
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi ChuckDrago,

You can try with:
Code:
Worksheets("Transfer").Range("G" & controw) = Round(Range("AF" & x + 2), 0)

Or give right click on cells you want to paste data and select format as number with "0" decimals.

Hope this helps

Regards
 
Upvote 0
Retribuyo saludos y gracias (había olvidado agradecer en mio respuesta anterior!)
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,476
Members
452,915
Latest member
hannnahheileen

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