how to select cells, then copy the same selected rows in another row

espenskeie

Well-known Member
Joined
Mar 30, 2009
Messages
636
Office Version
  1. 2016
Platform
  1. Windows
Hello

I have some selected cells in column A, they are not consecutive. I would like to copy these values and then copy the same area but from a different column...

The code I have here is only working when I have a consecutive selection.

Code:
Set rng = Selection


    fr = rng.Cells(1, 1).Row
    lr = rng(rng.Count).Row


    rng.Copy


Kind regards
Espen
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
try
this line allow you to select used range in Column "A"

Intersect(ActiveSheet.UsedRange, Columns(1)).Select

Good luck
 
Upvote 0
Thanks Useful :)

BTW the idea of fr and lr was to detect first and last row when I selected the area consecutive, but if I select by the use of Ctrl-button, then I cannot use firstrow and lastrow...

Anyway, first part of problem is now solved. Next problem is unfortunately waiting :)

Kind regards
Espen
 
Upvote 0
You are welcome! what is your second problem? to select only non blank cells?
 
Last edited:
Upvote 0
Hello Useful

Thank you for helping me, right now I just forgot where I was going. I have some issue with a lookup and match a datevalue, but I guess it is suited for a new thread. I will post it right away.

Kind regards
Espen
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,013
Members
448,935
Latest member
ijat

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