Hello,
I work for an online school and supervise 31 teachers. Twice a month, I run a report which gives me the number of hours each teacher has spent online. I output the report in an excel workbook. The output has 31 tabs for each teacher's information. The tabs are Sheet 1, Sheet 2, etc. I recorded a macro renaming each tab with the name of the teacher, so I wouldn't have to type each teacher's name every time I ran the report. Whe I tried to run the macro I got this error message:
Run-time error '9':
Subscript out of range
When I clicked on debug (I cannot debug VBA), I got this:
Sub SeatTabs()
'
' SeatTabs Macro
'
'
Sheets("1").Select
Sheets("1").Name = "Allen-Harmon"
Sheets("2").Select
Sheets("2").Name = "Allison"
Sheets("3").Select
Sheets("3").Name = "Baratko"
Sheets("4").Select
Sheets("4").Name = "Barot"
Sheets("5").Select
Sheets("5").Name = "BeisnerA"
Sheets("6").Select
Sheets("6").Name = "BeisnerD"
Sheets("Sheet7").Select
Sheets("Sheet7").Name = "BurchfieldG"
Sheets("Sheet8").Select
Sheets("Sheet8").Name = "BurchfieldT"
Sheets("Sheet9").Select
Sheets("Sheet9").Name = "Elliott"
Sheets("Sheet10").Select
Sheets("Sheet10").Name = "Fogle"
Sheets("Sheet11").Select
Sheets("Sheet11").Name = "Goubeaux"
Sheets("Sheet12").Select
Sheets("Sheet12").Name = "GriffithJ"
Sheets("Sheet13").Select
Sheets("Sheet13").Name = "GriffithM"
Sheets("Sheet14").Select
Sheets("Sheet14").Name = "Harris"
Sheets("Sheet15").Select
Sheets("Sheet15").Name = "Hellemann"
Sheets("Sheet16").Select
Sheets("Sheet16").Name = "HelsingerJ"
Sheets("Sheet17").Select
Sheets("Sheet17").Name = "HelsingerP"
Sheets("Sheet18").Select
Sheets("Sheet18").Name = "Jones"
Sheets("Sheet19").Select
Sheets("Sheet19").Name = "Koch"
Sheets("Sheet20").Select
Sheets("Sheet20").Name = "Leibold"
Sheets("Sheet21").Select
Sheets("Sheet21").Name = "Little"
Sheets("Sheet22").Select
Sheets("Sheet22").Name = "Lorz"
Sheets("Sheet23").Select
Sheets("Sheet23").Name = "MerkC"
Sheets("Sheet24").Select
Sheets("Sheet24").Name = "MerkJ"
Sheets("Sheet25").Select
Sheets("Sheet25").Name = "Miller"
Sheets("Sheet26").Select
Sheets("Sheet26").Name = "Mitter"
Sheets("Sheet27").Select
Sheets("Sheet27").Name = "Saylor"
Sheets("Sheet28").Select
Sheets("Sheet28").Name = "Seitz"
Sheets("Sheet29").Select
Sheets("Sheet29").Name = "Showalter"
Sheets("Sheet30").Select
Sheets("Sheet30").Name = "Statt"
Sheets("Sheet31").Select
Sheets("Sheet31").Name = "Swiger"
Range("M31").Select
End Sub
I don't know how to proceed at this point, or if the macro I need is possible. Any help would be appreciated. Thanks, again.
Andy
I work for an online school and supervise 31 teachers. Twice a month, I run a report which gives me the number of hours each teacher has spent online. I output the report in an excel workbook. The output has 31 tabs for each teacher's information. The tabs are Sheet 1, Sheet 2, etc. I recorded a macro renaming each tab with the name of the teacher, so I wouldn't have to type each teacher's name every time I ran the report. Whe I tried to run the macro I got this error message:
Run-time error '9':
Subscript out of range
When I clicked on debug (I cannot debug VBA), I got this:
Sub SeatTabs()
'
' SeatTabs Macro
'
'
Sheets("1").Select
Sheets("1").Name = "Allen-Harmon"
Sheets("2").Select
Sheets("2").Name = "Allison"
Sheets("3").Select
Sheets("3").Name = "Baratko"
Sheets("4").Select
Sheets("4").Name = "Barot"
Sheets("5").Select
Sheets("5").Name = "BeisnerA"
Sheets("6").Select
Sheets("6").Name = "BeisnerD"
Sheets("Sheet7").Select
Sheets("Sheet7").Name = "BurchfieldG"
Sheets("Sheet8").Select
Sheets("Sheet8").Name = "BurchfieldT"
Sheets("Sheet9").Select
Sheets("Sheet9").Name = "Elliott"
Sheets("Sheet10").Select
Sheets("Sheet10").Name = "Fogle"
Sheets("Sheet11").Select
Sheets("Sheet11").Name = "Goubeaux"
Sheets("Sheet12").Select
Sheets("Sheet12").Name = "GriffithJ"
Sheets("Sheet13").Select
Sheets("Sheet13").Name = "GriffithM"
Sheets("Sheet14").Select
Sheets("Sheet14").Name = "Harris"
Sheets("Sheet15").Select
Sheets("Sheet15").Name = "Hellemann"
Sheets("Sheet16").Select
Sheets("Sheet16").Name = "HelsingerJ"
Sheets("Sheet17").Select
Sheets("Sheet17").Name = "HelsingerP"
Sheets("Sheet18").Select
Sheets("Sheet18").Name = "Jones"
Sheets("Sheet19").Select
Sheets("Sheet19").Name = "Koch"
Sheets("Sheet20").Select
Sheets("Sheet20").Name = "Leibold"
Sheets("Sheet21").Select
Sheets("Sheet21").Name = "Little"
Sheets("Sheet22").Select
Sheets("Sheet22").Name = "Lorz"
Sheets("Sheet23").Select
Sheets("Sheet23").Name = "MerkC"
Sheets("Sheet24").Select
Sheets("Sheet24").Name = "MerkJ"
Sheets("Sheet25").Select
Sheets("Sheet25").Name = "Miller"
Sheets("Sheet26").Select
Sheets("Sheet26").Name = "Mitter"
Sheets("Sheet27").Select
Sheets("Sheet27").Name = "Saylor"
Sheets("Sheet28").Select
Sheets("Sheet28").Name = "Seitz"
Sheets("Sheet29").Select
Sheets("Sheet29").Name = "Showalter"
Sheets("Sheet30").Select
Sheets("Sheet30").Name = "Statt"
Sheets("Sheet31").Select
Sheets("Sheet31").Name = "Swiger"
Range("M31").Select
End Sub
I don't know how to proceed at this point, or if the macro I need is possible. Any help would be appreciated. Thanks, again.
Andy