dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,352
- Office Version
- 365
- 2016
- Platform
- Windows
My code is not adding a sheet, and it looks like it should. It only has the one sheet called July. What have I done wrong?
VBA Code:
Sub AddYP()
Dim NewYP As String
NewYP = Tracker.Cells(5, 4)
YP.Range("A" & Rows.Count).End(xlUp).Offset(1, 0) = NewYP
Call CreateWB(NewYP)
End Sub
Sub CreateWB(NewYP As String)
Dim wb1 As Workbook
Workbooks.Add.SaveAs Filename:=ThisWorkbook.Path & "\Young People\" & NewYP, FileFormat:=52
With Workbooks(NewYP)
Sheets(1).Name = "July"
Sheets.Add '.Name = "August"
End With
End Sub