Find last cell in row and copy/paste contents into first column

DebN

New Member
Joined
Sep 21, 2020
Messages
10
Office Version
  1. 2016
Platform
  1. Windows
Hello
Is there code/macro (I obviously have no idea about this) that would look at a datasheet by row and find the last cell in each row that has data in it and copy/paste that cell's data into column A.
For example if my data was something like the following image,
Initially, column A would be blank and then and if I ran such a magical macro, then it would look at each row starting with row 1 and paste the contents of E1 into the first column (A1)
Then it would look at the second row and paste the contents of G2 into cell A2.
Then it would look at the third row and paste the contents of C3 into cell A3
etc.....
1652459756431.png

You guys are amazing and I am hoping that you can help.
Thanks in advance!
Debbie
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Pick some arbitrary column you know you will never go past (I am using "Z" in this example).
Then, enter this in A1 and copy down:
Excel Formula:
=LOOKUP(2,1/(B1:Z1<>""),B1:Z1)
 
Upvote 0
Solution
Pick some arbitrary column you know you will never go past (I am using "Z" in this example).
Then, enter this in A1 and copy down:
Excel Formula:
=LOOKUP(2,1/(B1:Z1<>""),B1:Z1)
You rock Joe4!!
Thanks so much!!
:)
 
Upvote 0
You are welcome.
Glad I was able to help!
 
Upvote 0

Forum statistics

Threads
1,214,403
Messages
6,119,309
Members
448,886
Latest member
GBCTeacher

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