Copy row from one worksheet to another

Closed
PMYC - Aug 11, 2009 at 01:07 PM
kaiyasit Posts 30 Registration date Sunday August 9, 2009 Status Member Last seen April 20, 2010 - Aug 18, 2009 at 11:40 PM
Hello,
I have 11 worksheets in one workbook.
First sheet is "Master", Second is "New BB" ,Third is "New LB, Forth is Steelers and so on(football team names).
Then I enter on my "master" sheet, in col A "Id", col B "First Name, col C "Last Name" and so on(col N is the Team name)
Now how do I copy the row of info from "master sheet" to another sheet, if I entered Steelers as the team in col N and need that row of info on sheet named Steelers?
Now on the next row I enter nothing in the team and need that on the "New BB" sheet?

Please Help!
Thank you
PMYC

3 responses

kaiyasit Posts 30 Registration date Sunday August 9, 2009 Status Member Last seen April 20, 2010 12
Aug 12, 2009 at 06:12 AM
First question, you can use VLOOKUP()
Second question, i don't understand.
0
Sorry
This is all in one workbook. I have in my "master" worksheet. First row Column head names:
Id First Name Last Name Address City State Zip Phone Age Birthday

L/B Returnee Parent Name School Team Weight E-mail .

ok now I type all your info including the team you were on last year, say the Steelers. I need to have that line copied to another worksheet (same workbook) named "Steelers" next empty row in that worksheet or if I typed nothing for team, I would need to copy that row to a worksheet name "New" or "New Player" to the next empty row on that worksheet. But can it be done automatically?

Thank you this is for a non profit org.
www.pmycsports.com
PMYC
0
kaiyasit Posts 30 Registration date Sunday August 9, 2009 Status Member Last seen April 20, 2010 12
Aug 18, 2009 at 11:40 PM
Sorry......i'm very late...
Try to use below code....it may be help you

Sub TEST()
Dim Team As String
Dim Match As Boolean

Team = Sheets("Master").Range("N2")
Match = False
For Each b In Worksheets
If UCase(b.Name) = UCase("master") Then GoTo g
If UCase(Team) = UCase(b.Name) Then
Match = True
Call Copy1(b.Name)
Else
Match = False
End If
Debug.Print b.Name
g:
Next b


End Sub


Private Sub Copy1(ByVal SName As String)

Dim i As Integer
i = 2
Do Until Sheets(SName).Cells(i, 1) = "" Or Sheets(SName).Cells(i, 1) = Null
i = i + 1
Loop

Worksheets("Master").Range("A2:P2").Copy Destination:=Worksheets(SName).Range("A" & i)


End Sub
0