Insert Copied Rows And Maintain Selection

Draperies

Board Regular
Joined
Jun 29, 2009
Messages
79
Right now I have a macro that takes previously copied cells and inserts them to a new location using the following code:
Code:
Selection.EntireRow.Insert Shift:=xlDown
This works well enough except the copied cells are no longer selected after the insert, which I need so I can work with the selection. I have tried setting the active cell as a starting point and trying to figure out the number of rows of the selected text by creating a MSForms.DataOjbect but have had absolutely no luck going about it in this way. Does anyone have any suggestions?
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Show the code that does the Copy processing.
 
Upvote 0
Unfortunately there is no code that does the copying process. The user selects a range in another workbook and presses copy before running the macro.

This is also part of the reason why I had wanted to be able to work with the clipboard (so I could check and make sure they had copied valid information, enouch cells, etc. before continuing the macro). However, I'd certainly just be happy to do the insert and keep the inserted cells selected.
 
Upvote 0

Forum statistics

Threads
1,224,534
Messages
6,179,390
Members
452,909
Latest member
VickiS

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