Selection of range in end of column

wjeil

New Member
Joined
Feb 25, 2022
Messages
37
Office Version
  1. 365
Platform
  1. Windows
Hello,

I want to copy a selected range in 2 columns at the first available cell in another column.

Range("I1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Copy Cells(Rows.Count, "P").End(xlUp).Offset(1, 0)

This is what i did. So from "I" down till the last active cell and then also copy the according cells in H and then copy that data in the end of P.

But this does not work, what did i do wrong?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
How about
VBA Code:
Range("I1:H" & Range("I" & Rows.count).End(xlUp).Row).Copy Range("P" & Rows.count).End(xlUp).Offset(1)
 
Upvote 0
Yep, that works thanks. One more question, how can i delete in VBA the cells of an 2 column table that are empty?
 
Upvote 0
As that is a totally different question, it needs a new thread. Thanks
 
Upvote 0

Forum statistics

Threads
1,214,992
Messages
6,122,631
Members
449,095
Latest member
bsb1122

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