View Full Version : [SOLVED:] Copy values only not the formats.
Good evening,
This line of code works...
Range("C8:O8").Copy Range("C" & Rows.Count).End(xlUp).Offset(1, 0)
...but copies the formats etc as well.
How can I get it just to copy and paste the values please?
Thanks in advance.
mancubus
01-24-2017, 02:29 PM
Range.PasteSpecial method:
https://msdn.microsoft.com/en-us/library/office/ff839476.aspx
xlPasteType Enumaration:
https://msdn.microsoft.com/en-us/library/office/ff837425.aspx
Thanks for the reply mancubus,
I have got it working using...
Range("C8:O8").Copy
With ActiveSheet.Range("C" & Rows.Count).End(xlUp).Offset(1, 0)
.PasteSpecial Paste:=xlPasteValues
End With
I just thought there might have been a one line solution.
Thanks again.
If just wanting values, another way is:
ActiveSheet.Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Resize(, Range("C8:O8").Columns.Count).Value = Range("C8:O8").Value
Hope that helps,
Mark
Brilliant, thanks Mark,
I just took out the ActiveSheet. and it works great.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.