jwburritt

New Member
Joined
May 22, 2019
Messages
49
Office Version
  1. 365
Platform
  1. Windows
Hello: I'm trying to get rid of select on the following bit of code.

This works:

Range(ActiveCell.End(xlToRight), ActiveCell.Offset(0, 7).End(xlDown)).Cut
ActiveCell.End(xlToRight).Select
ActiveSheet.Paste


But when I try the following, I get Object Doesn't Support this property or method error:

Range(ActiveCell.End(xlToRight), ActiveCell.Offset(0, 7).End(xlDown)).Cut
ActiveCell.End(xlToRight).Paste


When I try the following, I get Application-defined or object-defined error:

Range(ActiveCell.End(xlToRight), ActiveCell.Offset(0, 7).End(xlDown)).Cut
Range(ActiveCell.End(xlRight)).Select
ActiveSheet.Paste

I've tried a few more and can't get it to work!

The macro is in my personal.xlsb.

Any help would be greatly appreciated!
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Not sure about your actual code, but ...

Rather than "select, cut and paste", try to use the syntax One.thing=Another.thing
For example,
Code:
Sheets("Sheet1").Range("C5").value = Sheets("Sheet2").Range("A15").value
then, if you really want the original range emptied...
Code:
Sheets("Sheet2").Range("A15").value = ""
or
Code:
Sheets("Sheet2").Range("A15").Clearcontents
 
Upvote 0
Hi,
untested but see if this update to your code does what you want

Code:
Dim Rng As Range
Set Rng = Range(ActiveCell.End(xlToRight), ActiveCell.Offset(0, 7).End(xlDown))
Rng.Cut Rng.End(xlToRight)

Dave
 
Upvote 0

Forum statistics

Threads
1,213,557
Messages
6,114,293
Members
448,564
Latest member
ED38

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