Try this. One proviso - your sheets are named exactly as the group id's,
and you may run into problems if these are numbers. For example
Thisworkbook.worksheets("5")
seems to also try
Thisworkbook.worksheets(5)
ie. if there is no sheet named "5" it will instead return the fifth sheet
(if there is one).
Tim
'********************
Option Explicit
Sub Tester()
Const ID_COL As Integer = 2 'col with group id
Dim r As Range
Dim s As Worksheet
Dim v As String
For Each r In ThisWorkbook.Sheets("Master").Range("A2

500").Rows
v = r.Cells(ID_COL).Value
If v <> "" Then
On Error Resume Next
Set s = ThisWorkbook.Worksheets(v)
On Error GoTo 0
If Not s Is Nothing Then
r.Copy s.Cells(s.Rows.Count, 1).End(xlUp).Offset(1, 0)
r.Interior.Color = vbGreen
Else
r.Interior.Color = vbRed
End If
End If
Next r
End Sub
"Randy" <(E-Mail Removed)> wrote in message
news:F9E65A4C-25BB-4AB5-9C70-(E-Mail Removed)...
> I'm looking for a macro that will copy data from a "master" sheet to
> individual sheets based on the sheet name. What I have is a master sheet
> containing 4 columns of data (one of which is a group id) that I manually
> sort by group and then manually copy that groups information into their
> own
> sheet. There are approximately 20 sheets (groups). What I need is a
> macro
> that will look at the sheet name (which is the group id) and then go back
> to
> the master sheet and pull all the rows of data that match that sheet name.
> Oh, I do have some sheets in the workbook that would be excluded from
> this.
>
> I know nothing about writing macros so any help will be greatly
> appreciated!
>
> Thanks!
>
> Randy