VBA to select and copy column to last row

Finalfight40

Active Member
Joined
Apr 24, 2018
Messages
273
Office Version
  1. 365
Platform
  1. Windows
Hi All

I am trying to create a macro but i am stuck with what i am assuming is a line or 2 of code. I have tried to google this but cant find exactly what i am looking for.

I am having a problem where i need to select and copy the data from cell A3 to the last row, in this case to A8. However there may be 5 entries or 1000 entries which i need to select.

Any help here is much appreciated.

A
1
2NAME
3Alex
4Bob
5Jessy
6Ben
7Joe
8Elliot
9

<tbody>
</tbody>
 
Last edited:

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
This will copy from A3 to the last row in column A.
Code:
Range("A3", Range("A" & Rows.Count).End(xlUp)).Copy
 
Upvote 0
Try this:
Code:
Sub Test()
'Modified 5/8/2018 7:03 AM  EDT
Application.ScreenUpdating = False
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Range("A3:A" & Lastrow).Copy
Application.ScreenUpdating = True
End Sub
 
Last edited:
Upvote 0
Try this:
Code:
Sub Test()
'Modified 5/8/2018 7:03 AM  EDT
Application.ScreenUpdating = False
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Range("A3:A" & Lastrow).Copy
Application.ScreenUpdating = True
End Sub

Also works very well thank you :)

Can i just ask if there would be a benefit to using one code over the other here?
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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