SyntaxFix
Write A Post
Hire A Developer
Questions
Try this
mainWB.Sheets.Add(After:=mainWB.Sheets(mainWB.Sheets.Count)).Name = new_sheet_name