guibgirl86
New Member
- Joined
- May 14, 2013
- Messages
- 22
I have a batch of data in several columns of different information. One of the columns is a label for the team name "Red" or "Blue" I want to sort the information for each team in a separate columns for that team. I have the code that will copy/paste the information I want into the columns I want, but I am having trouble figuring out how to get the pasting into the new column to be successive.
I have x to go down my main column of information, but I don't know how to call out y so that if O2 is filled then go to O3 and if W2 is filled then go to W3.
Any help is appreciated
Code:
dim x as long, y as long
For x = 2 To n Step 1 And y = 2
If Cells(x, 3).Value = "Blue" Then Range("B" & x, "C" & x, "H" & x, "J" & x, "K" & x, "L" & x).Copy ("O" & y)
If Cells(x, 3).Value = "Red" Then Range("B" & x, "C" & x, "H" & x, "J" & x, "K" & x, "L" & x).Copy ("W" & y)
Next x
I have x to go down my main column of information, but I don't know how to call out y so that if O2 is filled then go to O3 and if W2 is filled then go to W3.
Any help is appreciated