runtime error '1004' problems

eat_cress

New Member
Joined
Dec 5, 2010
Messages
37
I am having a lot of problems with a macro I am writing which cuts and pastes a row to another location on the sheet. I was wondering if anyone could help me? I have spent the last hour trying to get it figured out.

It keeps giving me a Run-time error '1004'

PasteSpecial method of Range class failed

when I go to debug it, it highlights the pastespecial part of the code. I have googled the quesion and tried to implement what they suggest, it doesnt work. I have looked at the code when I do it manually by using the macros recorder. the only difference is that my ranges are variable.

The code is below:

PHP:
    Range("F1").Select
    ActiveCell.FormulaR1C1 = "=IF(RC[-3]=RC[-2],"""",RC[-2])"
 
    Height = Range("a1").End(xlDown).Row
    nextrow = Range("a1").End(xlDown).Row + 1
    Range("F1").Select
    Selection.AutoFill Destination:=Range("F1:F" & Height), Type:=xlFillDefault
 
    Range("F1:F" & Height).Select
    Selection.Cut
    Range("C" & nextrow).Select
      Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

cheers for any help you can offer
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
You can't cut something and then use pastespecial as far as I know.

If you copy it you can PasteSpecial. Otherwise, you'll be stuck with a plain old paste.
 
Upvote 0
Try this.
Code:
With Range("F1:F" & Height)
    .Value = .Value
    .Cut Range("C" & nextrow)
    
End With
 
Upvote 0

Forum statistics

Threads
1,225,563
Messages
6,185,699
Members
453,315
Latest member
funktgf

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