ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change PasteSpecial (https://www.excelbanter.com/excel-programming/402952-change-pastespecial.html)

Dode

Change PasteSpecial
 
I'm bringing in data from various worksheets into one worksheet - with each
of the worksheets being copied into the last row. Problem : I'd like to
change the existing script from PasteSpecial to paste so I do not loose the
time format. Currently it is changing the data into a value (ie 12:00 AM =
..05060)

Have tried various wordings - pastevalue / value - but am not successful.

thanks


Windows("Extract data.xls").Activate
With Sheets("Interval")
lastrow = .Cells(.Rows.Count, "j").End(xlUp).Row
Application.Windows(2).Activate
Range("A1:J200").Copy
.Cells(lastrow + 1, "j").PasteSpecial Paste:=xlAll
End With

Jon Peltier

Change PasteSpecial
 
I usually use two paste special steps, with xlPasteValues and xlPasteFormats

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Dode" wrote in message
...
I'm bringing in data from various worksheets into one worksheet - with
each
of the worksheets being copied into the last row. Problem : I'd like to
change the existing script from PasteSpecial to paste so I do not loose
the
time format. Currently it is changing the data into a value (ie 12:00 AM
=
.05060)

Have tried various wordings - pastevalue / value - but am not successful.

thanks


Windows("Extract data.xls").Activate
With Sheets("Interval")
lastrow = .Cells(.Rows.Count, "j").End(xlUp).Row
Application.Windows(2).Activate
Range("A1:J200").Copy
.Cells(lastrow + 1, "j").PasteSpecial Paste:=xlAll
End With





All times are GMT +1. The time now is 10:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com