ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   .value only to 2 dp? (https://www.excelbanter.com/excel-programming/348717-value-only-2-dp.html)

dazman[_16_]

.value only to 2 dp?
 

Hi,

I have some cells in my worksheet that are numbers to 4 dp. I'm copying
them to other cells using

Me.Cells(3, 2).Value = Me.Cells(4, 2).Value

However the resultant values in the new cells are only to 2 dp (and I
get rounding errors), when the column has been set to always be 4dp.

Anyone have any idea as to a solution? Thanks, Daz


--
dazman
------------------------------------------------------------------------
dazman's Profile: http://www.excelforum.com/member.php...o&userid=25903
View this thread: http://www.excelforum.com/showthread...hreadid=495438


Toppers

.value only to 2 dp?
 
Dazman,
Works OK for me - are you sure you don't reformat the
cell(s)? And the number will work to 4 dp even if only 2 are displayed so I
don't understand the rounding problem.


"dazman" wrote:


Hi,

I have some cells in my worksheet that are numbers to 4 dp. I'm copying
them to other cells using

Me.Cells(3, 2).Value = Me.Cells(4, 2).Value

However the resultant values in the new cells are only to 2 dp (and I
get rounding errors), when the column has been set to always be 4dp.

Anyone have any idea as to a solution? Thanks, Daz


--
dazman
------------------------------------------------------------------------
dazman's Profile: http://www.excelforum.com/member.php...o&userid=25903
View this thread: http://www.excelforum.com/showthread...hreadid=495438



Ian

.value only to 2 dp?
 
You will get this situation if the destination cell is already formatted to
2dp. Copying the values in this way will not change the formatting.
Try this:

Me.Cells(3, 2).Value = Me.Cells(4, 2).Value
Me.Cells(3, 2).NumberFormat = Me.Cells(4, 2).NumberFormat

--
Ian
--
"dazman" wrote in
message ...

Hi,

I have some cells in my worksheet that are numbers to 4 dp. I'm copying
them to other cells using

Me.Cells(3, 2).Value = Me.Cells(4, 2).Value

However the resultant values in the new cells are only to 2 dp (and I
get rounding errors), when the column has been set to always be 4dp.

Anyone have any idea as to a solution? Thanks, Daz


--
dazman
------------------------------------------------------------------------
dazman's Profile:
http://www.excelforum.com/member.php...o&userid=25903
View this thread: http://www.excelforum.com/showthread...hreadid=495438





All times are GMT +1. The time now is 12:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com