VBA Code:
Sub Dispatch()
rng = shtWF.cells(1, 1).CurrentRegion
rprw1 = sht1500.cells(Rows.Count, "A").End(xlUp).Row + 1
rprw2 = sht3480.cells(Rows.Count, "A").End(xlUp).Row + 1
rprw3 = sht2958.cells(Rows.Count, "A").End(xlUp).Row + 1
rprw4 = sht2966.cells(Rows.Count, "A").End(xlUp).Row + 1
rprw5 = sht2990.cells(Rows.Count, "A").End(xlUp).Row + 1
rprw6 = sht9111.cells(Rows.Count, "A").End(xlUp).Row + 1
rprw7 = sht9129.cells(Rows.Count, "A").End(xlUp).Row + 1
For rw = 1 To UBound(rng)
If Right(rng(rw, 6), 4) = "1500" Then
For cl = 1 To UBound(rng, 2)
sht1500.cells(rprw1, cl) = rng(rw, cl)
Next
rprw1 = rprw1 + 1
End If
If Right(rng(rw, 6), 4) = "3480" Then
For cl = 1 To UBound(rng, 2)
sht3480.cells(rprw2, cl) = rng(rw, cl)
Next
rprw2 = rprw2 + 1
End If
If Right(rng(rw, 6), 4) = "2958" Then
For cl = 1 To UBound(rng, 2)
sht2958.cells(rprw3, cl) = rng(rw, cl)
Next
rprw3 = rprw3 + 1
End If
If Right(rng(rw, 6), 4) = "2966" Then
For cl = 1 To UBound(rng, 2)
sht2966.cells(rprw4, cl) = rng(rw, cl)
Next
rprw4 = rprw4 + 1
End If
If Right(rng(rw, 6), 4) = "2990" Then
For cl = 1 To UBound(rng, 2)
sht2990.cells(rprw5, cl) = rng(rw, cl)
Next
rprw5 = rprw5 + 1
End If
If Right(rng(rw, 6), 4) = "9111" Then
For cl = 1 To UBound(rng, 2)
sht9111.cells(rprw6, cl) = rng(rw, cl)
Next
rprw6 = rprw6 + 1
End If
If Right(rng(rw, 6), 4) = "9129" Then
For cl = 1 To UBound(rng, 2)
sht9129.cells(rprw7, cl) = rng(rw, cl)
Next
rprw7 = rprw7 + 1
End If
Next
End Sub
This code scans sheet "shtWF" for project numbers and if found copies the data to the correct project sheet. The code seems verbose and I know one of you geniuses will be able to show me the way.
Thanks in advance,
A guy trying to be better.