Tweek Paste Code (VBA)?

Mister H

Well-known Member
Joined
Mar 6, 2002
Messages
1,507
Hi:

Hopefully this is a simple process. I am using the following code in a Macro to paste some data.

Code:
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False


When I originally requested this code I only needed to copy the formatting however I have since added in formulas that are alos required. Can you PasteSpecial more then one option? Does this make sense? I need to paste the formatting but also some formulas? I assume if I Paste Special the formulas the formatting will not be pasted?

THANKS to any that can guide me,
Mark
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Code:
Selection.PasteSpecial Paste:=xlFormulas
Selection.PasteSpecial Paste:=xlFormats

This will first paste formats, then paste formulas - 2 lines of code, but you already copied the data and set the past range
 
Upvote 0
THANKS... Excuse my VBA ignorance but do I just paste the

Selection.PasteSpecial Paste:=xlFormulas after the xlFormats?

eg.

Code:
Selection.PasteSpecial Paste:=xlFormats, Selection.PasteSpecial Paste:=xlFormulas, Operation:=xlNone, SkipBlanks:= _ 
        False, Transpose:=False

The above is just part of the code I am using but it is the part that Pastes the selection.

THANKS Again,
Mark
 
Upvote 0
I re-ordered the code above - just replace the original code you had with the code I provided, and it should work
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

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