Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 152
Default Problem: Excel drops significant digits in copy value function...

I know there are certainly more efficient ways of managing this data and
should be in a database but this is what I have to work with right now.

Basically, I am copying values from one sheet to an equivilant sheet over a
specified range of cells.

The problem is that the value in the original sheet can be say: "1.2345".
It's copied into the var: newvalue as "1.2345" but this is what happens:
Sheets(tosheet).Range(start_range).Offset(row, col).Value turns into: "1.23"

Excel or VBA rounds the value to 2 decimals and pastes the rounded value
into the new sheet. I need it to paste the actual value.

Thanks for the help!
MikeZz

Here's a copy of my Sub:
===================
Sub CopyDataFromSheetToSheet(row1, row2, col1, col2, fromsheet, tosheet,
start_range)
Dim row, newvalue, col
'This copies all non-locked cells from equivalent sheets.
For row = row1 To row2
For col = col1 To col2
If Sheets(tosheet).Range(start_range).Offset(row, col).Locked =
False Then
newvalue = Sheets(fromsheet).Range(start_range).Offset(row,
col).Value
Sheets(tosheet).Range(start_range).Offset(row, col).Value =
newvalue
End If
Next
Next
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Problem: Excel drops significant digits in copy value function...

Try:
Tools Options Edit

and clear the fixed decimal checkbox
--
Gary's Student


"MikeZz" wrote:

I know there are certainly more efficient ways of managing this data and
should be in a database but this is what I have to work with right now.

Basically, I am copying values from one sheet to an equivilant sheet over a
specified range of cells.

The problem is that the value in the original sheet can be say: "1.2345".
It's copied into the var: newvalue as "1.2345" but this is what happens:
Sheets(tosheet).Range(start_range).Offset(row, col).Value turns into: "1.23"

Excel or VBA rounds the value to 2 decimals and pastes the rounded value
into the new sheet. I need it to paste the actual value.

Thanks for the help!
MikeZz

Here's a copy of my Sub:
===================
Sub CopyDataFromSheetToSheet(row1, row2, col1, col2, fromsheet, tosheet,
start_range)
Dim row, newvalue, col
'This copies all non-locked cells from equivalent sheets.
For row = row1 To row2
For col = col1 To col2
If Sheets(tosheet).Range(start_range).Offset(row, col).Locked =
False Then
newvalue = Sheets(fromsheet).Range(start_range).Offset(row,
col).Value
Sheets(tosheet).Range(start_range).Offset(row, col).Value =
newvalue
End If
Next
Next
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
significant digits Gordon[_2_] Excel Worksheet Functions 20 October 1st 08 07:14 PM
0987 show in the cell - the zero drops off-ned all 4 digits MikeR-Oz New Users to Excel 2 February 23rd 08 11:09 PM
how can I sum up the values with more than 15 significant digits? mohammad Excel Discussion (Misc queries) 5 October 25th 07 02:56 PM
Excel adds significant digits, resulting in errors in calculations Scoutwert Excel Worksheet Functions 6 September 19th 06 03:27 PM
Significant digits Marcus Excel Worksheet Functions 5 November 16th 05 03:39 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"