Copy cells and paste into every other cell

Macpop

New Member
Joined
Aug 20, 2014
Messages
14
I have a list of cells with data. I would like to copy the cells that meet the specific criteria then paste them in a new location. But the information must be pasted into every other row. These are worksheets that will be constantly updated and I will need to constantly have this happen.

I need a vba that will complete this.

Example:

Worksheet A


[TABLE="width: 500"]
<tbody>[TR]
[TD]NAME
[/TD]
[TD]STATE
[/TD]
[TD]SCORE
[/TD]
[TD]GRADE
[/TD]
[/TR]
[TR]
[TD]Max
[/TD]
[TD]FL
[/TD]
[TD]100
[/TD]
[TD]A
[/TD]
[/TR]
[TR]
[TD]Bill
[/TD]
[TD]TX
[/TD]
[TD]85
[/TD]
[TD]B
[/TD]
[/TR]
[TR]
[TD]Will
[/TD]
[TD]MS
[/TD]
[TD]50
[/TD]
[TD]F
[/TD]
[/TR]
[TR]
[TD]John
[/TD]
[TD]NY
[/TD]
[TD]98[/TD]
[TD]A
[/TD]
[/TR]
</tbody>[/TABLE]

Worksheet B

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]COLOR
[/TD]
[TD]COLOR
[/TD]
[TD]COLOR
[/TD]
[TD]COLOR
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]COLOR
[/TD]
[TD]COLOR
[/TD]
[TD]COLOR
[/TD]
[TD]COLOR
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Request FOR VBA

Based on worksheet A, I need Worksheet B to be populated based on the criteria of the A scores this way
[TABLE="width: 500"]
<tbody>[TR]
[TD]Max
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]COLOR
[/TD]
[TD]COLOR
[/TD]
[TD]COLOR
[/TD]
[TD]COLOR
[/TD]
[/TR]
[TR]
[TD]John
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]COLOR
[/TD]
[TD]COLOR
[/TD]
[TD]COLOR
[/TD]
[TD]COLOR
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thank you for any assistance that can be offered.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
run this on a copy of your file with sheet "A" as your active sheet.

Code:
Sub do_it()

wr = 1 'this is the row number to start writing the data to on sheet b
For r = 2 To Cells(Rows.Count, "A").End(xlUp).Row

If Cells(r, "D") = "A" Then
    Worksheets("B").Cells(wr, "A") = Cells(r, "A")
    wr = wr + 2
End If
Next r

End Sub

HTH,

Ross
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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