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


NAME
STATE
SCORE
GRADE
Max
FL
100
A
Bill
TX
85
B
Will
MS
50
F
John
NY
98A

<tbody>
</tbody>

Worksheet B

COLOR
COLOR
COLOR
COLOR
COLOR
COLOR
COLOR
COLOR

<tbody>
</tbody>

Request FOR VBA

Based on worksheet A, I need Worksheet B to be populated based on the criteria of the A scores this way
Max
COLOR
COLOR
COLOR
COLOR
John
COLOR
COLOR
COLOR
COLOR

<tbody>
</tbody>
Thank you for any assistance that can be offered.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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
Thank you!

This worked. I made the needed alterations to suit me, and it came off perfect.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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