I have the code finished and am running into one last issue.
I need the macro to run once for each row of information, something on the order of 225 times. I tried just copying the code 225 times in the macro, but it says the procedure is too long.
Is there a way to loop the macro to run a number of times based on a cell value?
Here is the code:
Dim newsht As Worksheet, ws As Worksheet
Dim ivalue As String
ivalue = Sheets("SUN Student Class Schedule").Range("C5").Value
For Each ws In Worksheets
If ws.Name = ivalue Then
MsgBox ("There is already a sheet with the name " & "*" & ivalue & "*")
Exit Sub
End If
Next ws
Set newsht = Worksheets.Add
With newsht
.Move After:=Sheets(Sheets.Count)
.Name = ivalue
End With
Sheets("Template").UsedRange.Copy Destination:=newsht.Range("A1")
newsht.Range("M3").Value = ivalue
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Template").UsedRange.Copy
Sheets("SUN Student Class Schedule").Select
Rows("5:5").Select
Selection.Delete Shift:=xlUp
Bookmarks