What I would like to do is to read through column g and compare cell by cell to see if there is an existing worksheet in the workbook with named like it.
If so copy that entire row to that worksheet and if not create a new worksheet with that name copy the 1st row of the original worksheet and then add the search row to it.
So if I had a worksheet with 100 entries of ten items I would end up with 11 worksheets, the original and ten more each with ten lines in them from the cell criteria with the sheet named after that criteria.
I started something but wont run. Am I on the right path?
Sub Parse_Sheets()
lr = Range("A1").End(xlDown).Row
'Get Vendor name
For ds = lr To 2 Step -1
shtn = Cells(ds, 7).Value
Rows(ds).Copy
'check existnce of sheet
For Each ws In ThisWorkbook.Worksheets
awsn = ActiveSheet.Name
If awsn <> shtn Then
activesheetname = shtn
Rows(ds).Paste
Sheets(Data).Select
Else
Sheets.Add
activesheetname = shtn
Rows(ds).Paste
Sheets(Data).Select
n1:
Next ds
End Sub
If so copy that entire row to that worksheet and if not create a new worksheet with that name copy the 1st row of the original worksheet and then add the search row to it.
So if I had a worksheet with 100 entries of ten items I would end up with 11 worksheets, the original and ten more each with ten lines in them from the cell criteria with the sheet named after that criteria.
I started something but wont run. Am I on the right path?
Sub Parse_Sheets()
lr = Range("A1").End(xlDown).Row
'Get Vendor name
For ds = lr To 2 Step -1
shtn = Cells(ds, 7).Value
Rows(ds).Copy
'check existnce of sheet
For Each ws In ThisWorkbook.Worksheets
awsn = ActiveSheet.Name
If awsn <> shtn Then
activesheetname = shtn
Rows(ds).Paste
Sheets(Data).Select
Else
Sheets.Add
activesheetname = shtn
Rows(ds).Paste
Sheets(Data).Select
n1:
Next ds
End Sub