VBA Cut/Paste

Pinaceous

Well-known Member
Joined
Jun 11, 2014
Messages
1,124
Office Version
  1. 365
Platform
  1. Windows
Good Day All,

I'm trying to Cut/Paste:

VBA Code:
    Range("AU6:CM36").Select
    Selection.Cut
    Range("B78").Select
    Selection.Paste

But I'm getting an error message:

Capture2.PNG


Also, does anyone know why?

Also, Also, does anyone know how to paste values after a Cut?

Please let me know.

Thank you!
pinaceous
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
What about just this instead of those 4 lines of code?

VBA Code:
Range("AU6:CM36").Cut Range("B78")

:oops: Oops, @Osvaldo Palmeiro already suggested that
 
Upvote 0
how to paste values after a Cut?
You can't do that one step. The simplest is probably this:
VBA Code:
Sub Cut_Paste()
    With Range("AU6:CM36")
        .Copy
        Range("B78").PasteSpecial xlPasteValues
        Range("B78").PasteSpecial xlPasteFormats    ' Cut and paste brings over the formatting
        .Clear                                      ' Use .ClearContents if you want to leave the formatting in the original range
    End With
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

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