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

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
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,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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