Hi
The code copies the data on the master sheet (MasterData) and then takes the first cell on the list (Splitcode) and hides it using a filter and deletes all the other rows so only rows with that cell remain and renames the sheet as that cell.
Then goes down the list and makes a sheet for each cell on that list.
so on this instance it filters the 6th column to see if it matches the cell. so when I use text on the 6th column and the list it works perfectly.
but when I use numbers it doesn't work at all and highlights this code:
anyone know how to make it work on numbers
Thank you
The code copies the data on the master sheet (MasterData) and then takes the first cell on the list (Splitcode) and hides it using a filter and deletes all the other rows so only rows with that cell remain and renames the sheet as that cell.
Then goes down the list and makes a sheet for each cell on that list.
Code:
Sub SplitandFilterSheet()
Dim Splitcode As RangeSheets("Master").SelectSet Splitcode = Range("Splitcode")For Each cell In SplitcodeSheets("Master").Copy After:=Worksheets(Sheets.Count)ActiveSheet.Name = cell.ValueWith ActiveWorkbook.Sheets(cell.Value).Range("MasterData").AutoFilter Field:=6, Criteria1:="NOT EQUAL TO" & cell.Value, Operator:=xlFilterValues.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.DeleteEnd WithActiveSheet.AutoFilter.ShowAllDataNext cellEnd Sub
so on this instance it filters the 6th column to see if it matches the cell. so when I use text on the 6th column and the list it works perfectly.
but when I use numbers it doesn't work at all and highlights this code:
Code:
[COLOR=#0A0A0A][FONT=Roboto]With ActiveWorkbook.Sheets(cell.Value).Range("MasterData")[/FONT][/COLOR]
anyone know how to make it work on numbers
Thank you