I'm trying to use a sheet to base other sheets on. When I have to
create a new sheet I'm using the following code.
Sub subCreateNewSheet(spType As String, _
spOldSchool As String)
' Copy base sheet and rename.
Dim slDSheet As String
Dim ilSheetNum As Integer
Dim ilNewSheetNum As Integer
Application.DisplayAlerts = False
DoEvents
slDSheet = UCase$(spType & " " & spOldSchool)
On Error Resume Next
Sheets(slDSheet).Delete
On Error GoTo 0
Sheets(spType & " School").Copy before:=Sheets(1)
Sheets(1).Name = slDSheet
Sheets(1).Name = slDSheet
Application.DisplayAlerts = True
End Sub
I'm getting an error 1004 at the copy line.
Anyone kave a clue why?