Hello,
Ended up with some compouding issues on my last post and decided to delete and split into two posts.
Have a spreadsheet with student performance and a macro to copy each student's data from the master sheet into a new tab.
The macro now creates a tab for each cell in the range, as some co workers have smaller classes, would like to modify the macro to stop when it hits an empty cell. Tried Do until isempty but was not able to make that work. Any suggestions would be great. Thanks.
the macro
Sub PagesByDescription()
Dim rRange As Range, rCell As Range
Dim wSheet As Worksheet
Dim wSheetStart As Worksheet
Dim strText As String
Set wSheetStart = ActiveSheet
wSheetStart.AutoFilterMode = False
'Set a range variable to the correct item column
Set rRange = Range("A9:A50")
On Error Resume Next
With wSheetStart
For Each rCell In rRange
strText = rCell
.Range("A9").AutoFilter 1, strText
Worksheets(strText).Delete
'Add a sheet named as content of rCell
Worksheets.Add().Name = strText
'Copy the visible filtered range _
(default of Copy Method) And leave hidden rows
.UsedRange.Copy Destination:=ActiveSheet.Range("A1")
ActiveSheet.Cells.Columns.AutoFit
Next rCell
End With
With wSheetStart
.AutoFilterMode = False
.Activate
End With
On Error GoTo 0
Application.DisplayAlerts = True
End Sub
Test1.xlsm
Bookmarks