I am trying to use VBA to sort a list that will be autogenerated and copy to various worksheets in the workbook based on the results. I have a workbook that lists a set of issues that have occured in a certain job and my boss wants this to be sorted per job. Here is what I have worked up so far and my problim is that 31241101 only occurs once but the find will pick it up multiple times, I need something to tell it to only search through once not to keep going through the entire list and finding the same stuff. As you can probably tell I am pretty new to VBA, here is a copy of what I have so far:
Sub sortandopy()
'search for "312411"
Worksheets("sheet1").Select
Cells.Find(What:="31241101", After:=Range("A1"), SearchDirection:=xlPrevious).Select
ActiveCell.EntireRow.Copy
Worksheets("312411").Select
ActiveSheet.Range("B1").Select
ActiveCell.Offset(1, -1).Range("A1").Select
ActiveSheet.Paste
Worksheets("sheet1").Select
Cells.Find(What:="31241101", After:=Range("A1"), SearchDirection:=xlPrevious).Select
ActiveCell.EntireRow.Copy
Worksheets("312411").Select
ActiveSheet.Range("B1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, -1).Range("A1").Select
ActiveSheet.Paste
Worksheets("sheet1").Select
End Sub
Any help would be appreciated
Sub sortandopy()
'search for "312411"
Worksheets("sheet1").Select
Cells.Find(What:="31241101", After:=Range("A1"), SearchDirection:=xlPrevious).Select
ActiveCell.EntireRow.Copy
Worksheets("312411").Select
ActiveSheet.Range("B1").Select
ActiveCell.Offset(1, -1).Range("A1").Select
ActiveSheet.Paste
Worksheets("sheet1").Select
Cells.Find(What:="31241101", After:=Range("A1"), SearchDirection:=xlPrevious).Select
ActiveCell.EntireRow.Copy
Worksheets("312411").Select
ActiveSheet.Range("B1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, -1).Range("A1").Select
ActiveSheet.Paste
Worksheets("sheet1").Select
End Sub
Any help would be appreciated