cut and insert with a single line

RSXchin

Well-known Member
Joined
Oct 23, 2010
Messages
758
is there a single line version of this?
PHP:
Range("E:F").Cut        
Range("A:B").Insert shift:=xlToRight
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Rich (BB code):
Range("E:F").Cut: Range("A:B").Insert shift:=xlToRight


You will be on one line... or else!
 
Upvote 0
I was totally screwing around. I wasn't intending to answer your question, I thought somebody would get you a unique function or combination of methods that would accomplish what you wanted.

You can do that with any statement, you know that? Adding a colon is exactly like adding a line break.
 
Upvote 0
Indeed, AFAIK, this is not possible.
 
Upvote 0
Whether or not you were joking, it still works how I needed it to. Do you know if it counts as 2 lines though? ONCE I had a problem with a module that was too big and couldn't be compiled.

Either way, I'll leave it with the colon because it makes the code look cleaner.
 
Upvote 0
Do you know if it counts as 2 lines though? ONCE I had a problem with a module that was too big and couldn't be compiled.

I do not really know how it adds to the limit, but I must tell you that I never encountered a situation where I reached the limit for compilation... and I wrote big chunks of code before. The thing is... did you WRITE code, or did you RECORD code using the macro recorder? The last one has the tendency to become somewhat bigger than needed (understatement).
 
Upvote 0
before I learned how to loop through arrays (and later how to loop through an array of arrays), my code was about 1500 lines long. Now it's only about 250.

And it can still get shorter...
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,153
Members
452,891
Latest member
JUSTOUTOFMYREACH

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