Cut and paste VBA or copy and paste

NewbieMike

New Member
Joined
May 29, 2015
Messages
4
Hello, on a daily basis, I will have a random number of rows(it will always be A2:AD??) entered on "sheet1" and would like to either cut and paste or copy and paste that range to the first available row on "sheet2". I have been searching the forums all day and can't seem to find what I'm looking for. Can anyone help please? I appreciate any and all help! :)
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

kasanari

New Member
Joined
May 29, 2015
Messages
12
Hello, on a daily basis, I will have a random number of rows(it will always be A2:AD??) entered on "sheet1" and would like to either cut and paste or copy and paste that range to the first available row on "sheet2". I have been searching the forums all day and can't seem to find what I'm looking for. Can anyone help please? I appreciate any and all help! :)

A simple solution assuming there are no gaps in data would be (paste values also)
sub XXX ()

Sheets("sheet1").activate
Range("A2:AD2").select
Range(selection, selection.end(xlDown)).select

Selection.Copy

Sheets("sheet2").activate

range("A1").select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
end sub

hope this helps
 

NewbieMike

New Member
Joined
May 29, 2015
Messages
4
kasanari, I changed the end to paste to the first available cell on "Sheet2" but the rest worked beautifully!!! Thank you so much, you are awesome!!!;)
 

kasanari

New Member
Joined
May 29, 2015
Messages
12
kasanari, I changed the end to paste to the first available cell on "Sheet2" but the rest worked beautifully!!! Thank you so much, you are awesome!!!;)

Woops sorry! I read that as the first cell! Well I'm glad you got it!
 

Watch MrExcel Video

Forum statistics

Threads
1,130,112
Messages
5,640,174
Members
417,130
Latest member
Darion2021

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
Top