VBA Paste into blank row

cab401

New Member
Joined
Jun 14, 2018
Messages
13
I have little knowledge of VBA but I think this should be a simple request. I would like to copy data from all rows (Columns B:K) in which Column B contains text, starting in B9 on Sheet2. I would like to paste this data into the first row after B12 in which Column B has a blank cell on Sheet1.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Try this:
Code:
Sub Copy_Me()
'Modified 6/1/2019 12:56:39 AM  EDT
Application.ScreenUpdating = False
Dim Lastrow As Long
Lastrow = Sheets(2).Cells(Rows.Count, "B").End(xlUp).Row
Dim Lastrowa As Long
Lastrowa = Sheets(1).Cells(Rows.Count, "B").End(xlUp).Row + 1
If Lastrowa < 12 Then Lastrowa = 12
Sheets(2).Cells(9, "B").Resize(Lastrow - 8, 10).Copy Sheets(1).Cells(Lastrowa, "B")
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Thank you for the response however I receive an “Object Required” error when trying to run this.
 
Upvote 0

Forum statistics

Threads
1,215,817
Messages
6,127,041
Members
449,356
Latest member
tstapleton67

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