Copy Dependent On Cell Value

T

Timbo

I have data on Sheet1 Range A5:E25, A contains text B:E contains
values.

I want to copy the data from Sheet1 to Sheet 2 dependent on the text in
Sheet 1 Column A.

Example:

If A5 on Sheet 1 is <> than "Other Publisher Groups" I want to copy
A5:E5 to Sheet 2 cell B4:F4.

If A5 on Sheet 1 is ="Other Publisher Groups" I want to drop down a row
and copy A6:E6 to Sheet 2 cell B4:F4.

In short If the value in A is <> to "Other Publisher Groups" I want to
copy

Sheet1 A5:E5 to Sheet 2 B4:F4 Then
Sheet1 A6:E6 to Sheet 2 B5:F5
Sheet1 A7:E7 to Sheet 2 B6:F6

If Sheet1 A8 = "Other Publisher Groups" I would jump a row i.e.

Sheet1 A9:E9 to Sheet 2 B7:F7

Hope that makes sense.
 
J

Joel

I think you just want to copy rows that don't havve "Other Publisher Groups"

Sub movedata()

DestRow = 4
With Sheets("Sheet1")
RowCount = 4
Do While .Range("A" & RowCount) <> ""
If .Range("A" & RowCount) <> "Other Publisher Groups" Then
.Range("A" & RowCount & ":E" & RowCount).Copy _
Destination:=Sheets("Sheet2").Range("B" & DestRow)
DestRow = DestRow + 1
End If
RowCount = RowCount + 1
Loop

End With

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top