Vba paste special error

scoha

Active Member
Joined
Jun 15, 2005
Messages
428
I have the following lines which are part of code to copy from a named range (NewName_451) to the next free line of column range (RangeNames451):

Code:
Range("NewName_451").Copy Range("c8").End(xlDown).Offset(1,0)

But I don't want to copy the cell format, just the text. How do I modify code so it just pastes the text, tried adding PasteSpecial Paste:=xlPasteValues but get an error message,
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Paste special requires two separate vba commands:
Code:
Range("NewName_451").Copy 
Range("C8").End(xlDown).Offset(1).PasteSpecial xlPasteValues
 
Upvote 0
Hi scoha,

As long as there's something in Col C past Row 8 (or else the code will error as it will be trying to go off the page), this will work:

Code:
Range("NewName_451").Copy
    Range("C8").End(xlDown).Offset(1, 0).PasteSpecial Paste:=xlPasteFormulas
    Application.CutCopyMode = False

HTH

Robert
 
Upvote 0
If you want to keep it as a one-liner, maybe try:
Code:
Range("c8").End(xlDown).Offset(1, 0).Value = Range("NewName_451").Value
 
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,445
Members
452,915
Latest member
hannnahheileen

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