The way I would do it is in code (I used dashes for indenting - you can do a find replace for "-", replace with " "):
Sub Separate()
Dim intRow as Integer
Dim intJobCol as Integer
Dim intPermRow as Integer
Dim intAgencyRow as Integer
Sheets("Master").Select
intRow = 1
intPermRow = 1
intAgencyRow = 1
intCol = 2
Do While Trim(Cells(intRow, intCol).Text) <> ""
----Select Case Trim(Cells(intRow, intCol).Text)
----Case "perm"
--------Sheets("Sheet2").Cells(intPermRow, 1).Value = _
--------Sheets("Master").Cells(intRow, intCol).Value
--------intPermRow = intPermRow + 1
----Case "agency"
--------Sheets("Sheet2").Cells(intAgencyRow, 1).Value = _
--------Sheets("Master").Cells(intRow, intCol).Value
--------intAgencyRow = intAgencyRow + 1
----Case Else
----' Do nothing?
----End Select
----intRow = intRow + 1
Loop
End Sub
Hope this helps,
Russell
If you can afford a hidden column, you could put this in column C on Master and copy down.
=B1&COUNTIF($B$1:B1,B1)
To list your perms, you could use
=IF(ROW()<=COUNTIF('Master Sheet'!$B$1:$B$6,"perm"),INDEX('Master Sheet'!A1:C6,MATCH("perm"&ROW(),'Master Sheet'!C1:C6,0),1),"")
and copy it down
Same formula for agency substituting your key word
=IF(ROW()<=COUNTIF('Master Sheet'!$B$1:$B$6,"agency"),INDEX('Master Sheet'!A1:C6,MATCH("agency"&ROW(),'Master Sheet'!C1:C6,0),1),"")
Good luck.
Thanks, will test these tomorrow.
not sure how to get this to work?
it all look strange to me (having JUST start learning VB), if possible could you add comment as to what/why things are doing. Do I need to do anything on the sheet (field names, defining names, etc.)
thanks Ian