pasteformats

288enzo

Well-known Member
Joined
Feb 8, 2009
Messages
721
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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
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,214,965
Messages
6,122,496
Members
449,089
Latest member
Raviguru

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