I'm trying to cut the contents of cell K7 (100) and paste it into M7 using VBA (see below) but I keep getting an error (see below). Where am I going wrong?:
Sub CutPaste()
Worksheets("Sheet2Test").Activate
Range("K7").Select
Selection.Cut
Range("M7").Select
Selection.Paste
End Sub
Its better to avoid Select
altogether. Use this
Worksheets("Sheet2Test").Range("K7").Cut Worksheets("Sheet2Test").Range("M7")
Just replace Selection.Paste
for ActiveSheet.Paste
, so it would be:
Sub CutPaste()
Worksheets("Sheet2Test").Activate
Range("K7").Select
Selection.Cut
Range("M7").Select
ActiveSheet.Paste
End Sub
That would do the paste as you wanted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With