VBA to copy data from one sheet and paste to blank row of another

srj1359

New Member
Joined
Mar 5, 2015
Messages
46
Office Version
  1. 2016
Platform
  1. Windows
Hi there! I'm needing to copy a range of data from one sheet (Pricing) to another sheet (Multiple Participants) and I need it to paste to the first blank row each time I push the macro button.

For example: I choose customer A in the pricing tab, push the button, it copies the range and pastes to the multiple participants tab. I then go back to pricing and choose customer B, push the button, it copies the range and pastes in multiple participants below customer A data.

Here is the code I currently have. All ranges that have a 9 (B9, I9, K9) are because row 9 is the first blank row under my headers. So I need to change that range to be the first blank row in each of those columns.

Sheets("Pricing Sheet").Select
Range("B22:G22").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Multiple Participants").Select
Range("B9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Pricing Sheet").Select
Range("J22:K22").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Multiple Participants").Select
Range("I9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Pricing Sheet").Select
Range("L22:M22").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Multiple Participants").Select
Range("K9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'get last row of Pricing
Dim lrowCQ As Integer
lrowCQ = Range("B" & Rows.Count).End(xlUp).End(xlUp).End(xlDown).Row

Any assistance you can provide is greatly appreciated. Thank you!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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