Costas
Member
Hi Chandoo,
I've got a massive table of 25 columns and 50,000 rows which I'm creating by copying and pasting selected columns from a larger raw data table.
I'd like to round to 2 decimals the values that I'm copying from the raw data table either during the copy/paste process or afterwards when the columns are pasted in my working table.
The only way I found to be working is to loop through each row in a column and round the raw value with this code
This process takes at least an hour to run per column so I was wondering if there is a quicker way.
I've already tried
and
but they don't work.
Any suggestions?
I've got a massive table of 25 columns and 50,000 rows which I'm creating by copying and pasting selected columns from a larger raw data table.
I'd like to round to 2 decimals the values that I'm copying from the raw data table either during the copy/paste process or afterwards when the columns are pasted in my working table.
The only way I found to be working is to loop through each row in a column and round the raw value with this code
Code:
For Each MyCell In MyObject.ListColumns(12).DataBodyRange
MyCell.Value = Round(MyCell, 2)
Next MyCell
This process takes at least an hour to run per column so I was wondering if there is a quicker way.
I've already tried
Code:
MyObject.Range.Columns(12) = Round(MyObject.Range.Columns(12).Value, 2)
and
Code:
Sheets("GDB").Range("Tbl_GDB[Cost (Ex)]").Copy
Round(MyObject.DataBodyRange(1, 12).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False,2)
Any suggestions?