pasteformats

288enzo

Well-known Member
Joined
Feb 8, 2009
Messages
723
Office Version
  1. 2016
Platform
  1. Windows
Will someone please explain what is wrong with this?

The first line works perfectly, when ran separately I can see the all contents with the copy box around it.

VBA Code:
    Range(Range("H7"), Range("H7").End(xlDown)).Copy
    Range(Range("I7"), Range("I7").End(xlDown)).PasteSpecial Paste:=xlPasteFormats

On the second line I get, Run-time error 1004 - PasteSpecial method of Range class failed.

Thank you,
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
You only need to identify the first cell of the range that you want to paste into:
VBA Code:
    Range(Range("H7"), Range("H7").End(xlDown)).Copy
    Range("I7").PasteSpecial Paste:=xlPasteFormats
 
Upvote 0
Solution
You only need to identify the first cell of the range that you want to paste into:
VBA Code:
    Range(Range("H7"), Range("H7").End(xlDown)).Copy
    Range("I7").PasteSpecial Paste:=xlPasteFormats
So simple, thank you very much.
 
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,982
Members
449,201
Latest member
Lunzwe73

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