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:
cheers for any help you can offer
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