I have the following code that moves rows to a specific worksheet where a cell value in column M is equal to value: 'not planned'
Sub Not_Planned()
Sheets("All Data").Select
RowCount = Cells(Cells.Rows.count, "a").End(xlUp).Row
For i = 1 To RowCount
Range("M" & i).Select
check_value = ActiveCell
If check_value = "not planned" Then
ActiveCell.EntireRow.Copy
Sheets("Not Planned").Select
RowCount = Cells(Cells.Rows.count, "a").End(xlUp).Row
Range("a" & RowCount + 1).Select
ActiveSheet.Paste
Sheets("All Data").Select
Range("A2").Select
End If
Next
End Sub
Is there a way to adapt the code so it runs through all rows and copies the row to a worksheet where the value in column A is equal to a worksheet name ?
Please note: I already have a code that creates worksheets and names them as per unique values in column A.
Thanks