Hi all,
Been working on this problem most of the afternoon:
I am transposing data from a data sheet to a temporary sheet, sorting it, and then transposing it back to the original formatting on the data sheet. I am avoiding using "Copy" and "Paste," so therefore I have not been using PasteSpecial, etc.
Here is what I have right now:
The problem comes at the first 'transpose' line where any numbers with 0's after a decimal are lost. For example if I have 0.10, during the transpose and then after it is added back to the data sheet it appears as 0.1.
I tried adding the xlRangeValueDataType Enumeration(11) after the .Value part, but that gives me an error since I can't do the same to the right side of the equation (I think).
How can I do this while conserving decimal places?
Thanks!
Been working on this problem most of the afternoon:
I am transposing data from a data sheet to a temporary sheet, sorting it, and then transposing it back to the original formatting on the data sheet. I am avoiding using "Copy" and "Paste," so therefore I have not been using PasteSpecial, etc.
Here is what I have right now:
Code:
'Sets rng as the range to copy
rng = Sheets(MWS).Range("H" & NextBlank, ConvertToLetter & NextBlank + 1)
'Transposes the chem data range to the temp sheet
Sheets("Temp").Range("A1:B" & lastCol - 7).Value = Application.Transpose(rng)
'Sorts data on temp via max values
Worksheets("Temp").Range("A1:B" & lastCol - 7).Sort _
Key1:=Worksheets("Temp").Range("B:B"), Order1:=xlDescending
'Copy data back to spec sheet
Sheets(MWS).Range("H" & NextBlank, ConvertToLetter & NextBlank).Value = Application.Transpose(Sheets("Temp").Range("A1:A" & lastCol - 7))
The problem comes at the first 'transpose' line where any numbers with 0's after a decimal are lost. For example if I have 0.10, during the transpose and then after it is added back to the data sheet it appears as 0.1.
I tried adding the xlRangeValueDataType Enumeration(11) after the .Value part, but that gives me an error since I can't do the same to the right side of the equation (I think).
How can I do this while conserving decimal places?
Thanks!