PasteSpecial Values and cell format

cccbzg

Board Regular
Joined
Oct 5, 2014
Messages
68
Office Version
  1. 365
Platform
  1. Windows
Hi,

This is a snippet of my excel macro. I can't seem to figure out how to paste both the values AND the cell formatting. I get the values I need but have had weird formatting output with all of my attempts. Any help would be much appreciated. Thanks all of you Mr. Excel heroes!!

Dim copySheet As Worksheet
Dim pasteSheet As Worksheet
Set copySheet = Worksheets("Summary Sheet")
Set pasteSheet = Worksheets("Your Dates")
Application.ScreenUpdating = False
copySheet.Range("A" & i & ":M" & i).Copy
pasteSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1).PasteSpecial xlPasteValues
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Try adding next line

Selection.PasteSpecial Paste:=xlFormats
 
Upvote 0
Thanks for this suggestion. It did get me the formats, but not from the worksheet I want the format from. How can I specify? Or connect this to my xlPasteValues command?

Many thanks,
Bonnie
 
Upvote 0
how about
Code:
With pasteSheet.Cells(Rows.count, 1).End(xlUp).Offset(1)
   .PasteSpecial xlPasteValues
   .PasteSpecial xlFormats
End With
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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