excel vba no code executed after Worksheets.add
I'm trying to create a bunch of tabs in a new workbook, with specific
names taken from a range in another workbook. In the example below the
first msgbox is executed but never the second. all of the tabs get
created, but they don't get renamed.
Sub CreateInstructorSheet(r As Range)
Dim tabname As String
tabname = r.Offset(0, 1).Value
MsgBox tabname + " 1"
newtab = wb.Worksheets.Add
MsgBox tabname + " 2"
newtab.Name = tabname
End Sub
I've also tried using Sheets.add, and providing parameters in the add
statement.
No comments:
Post a Comment