past special VBA

jtodd

Board Regular
Joined
Aug 4, 2014
Messages
194
Hi
can anyone show me how to change this macro to paste values and formats but not formulas.

Sub CopyStuff()

Range("AA4:AD34").Copy

Sheets("SummaryData").Cells(1, Columns.Count).End(xlToLeft).Offset(0, 1).PasteSpecial xlPasteValues

End Sub


if i try and add more than 1 pastespecial it comes up with errors ??
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Code:
.PasteSpecial xlPasteFormats+xlPasteValues
 
Upvote 0
Try

Code:
With Sheets("SummaryData").Cells(1, Columns.Count).End(xlToLeft).Offset(0, 1)
  .PasteSpecial xlPasteValues
  .PasteSpecial xlPasteFormats
End With
 
Upvote 0
Again thanks for your quick reply but again i get a debug message , the first pastespecial is highligted .
 
Upvote 0
Sorry , i have just tried again and it works fine , user error.;)

Many thanks for your help
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top