Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
significant digits | Excel Worksheet Functions | |||
0987 show in the cell - the zero drops off-ned all 4 digits | New Users to Excel | |||
how can I sum up the values with more than 15 significant digits? | Excel Discussion (Misc queries) | |||
Excel adds significant digits, resulting in errors in calculations | Excel Worksheet Functions | |||
Significant digits | Excel Worksheet Functions |