Excel in the Round

Wolverine

New Member
Joined
Apr 24, 2002
Messages
1
I'm using VBA's TransferSpreadsheet to export a table from Access to Excel, thereby creating a new .XLS file.

Some of the columns in my Access table contain numbers representing prices, but those numbers are held to many decimal places.

I want those numbers to appear in the spreadsheet, but rounded up to the nearest penny, i.e. to 2 d.p.'s. Is there any way I can (from within my Access VBA code) specify or alter the format of particular Excel columns, so that the data appears as I would like it to, rather than having to do all of the rounding up in Access (and thereby losing the less significant decimal places of my data) ?

Thanks,

Pat Gale
England
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
In Access, create a query that does the rounding and export the results of the query to Excel. Your original data will stay intact and you will have what you want in Excel.
 
Upvote 0

Forum statistics

Threads
1,214,625
Messages
6,120,598
Members
448,973
Latest member
ksonnia

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