PDA

View Full Version : Solved: Formatting Edit



Alex O
05-19-2011, 07:38 AM
How would my macro be edited to keep number formats exactly as they are in the source sheet? ie 262.22 becomes 262.2225. Any help is appreciated.

Sub NewUploadFile()
Workbooks.Add
ThisWorkbook.Worksheets(3).Range("A1:AB2000").Copy
Range("A1").PasteSpecial Paste:=xlPasteValues
Range("A1").PasteSpecial Paste:=xlPasteFormats
Columns.AutoFit
End Sub

Rob342
05-19-2011, 02:49 PM
Try


Selection.NumberFormat = "0.00"

Kenneth Hobs
05-19-2011, 08:16 PM
I don't see a problem. I would add one more line of code.
Range("A1").Select

Alex O
05-20-2011, 09:16 AM
Got it...thanks!