View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Changing name of worksheet based on data in cell of another worksheet

was thinking very hard :
Garry:

I am trying to make this process as easy for my intructors as possible
and yes there is a need to have a sheet for each student. Having the
worksheets name change automatically was just an idea I had to help
make the process as automated as possible. The intent is to have the
Class Commanders of each class only have to enter the names in once
(on the "input sheet"). I have verified that the cells on the "input
sheet" are cells B13 through B30 and yes there are 18 different
worksheets named Stud1 through Stud18. Hope that helps.

Brad


Brad,
Thanks for the additional info. I've duplicated your scenario and ran
Paul's code 'as is' and it works fine for me. However, it could be
condensed somewhat to obviate the overhead of the unecessary
variables...

Sub ChangeTabNames2()
Dim rng As Range, sTemp As String, i As Integer
Application.ScreenUpdating = False
For Each rng In Worksheets("Sheet1").Range("B13:B30")
i = i + 1: sTemp = "Stud" & i
Sheets(sTemp).Name = sTemp & rng.Value
Next rng
End Sub

--
Garry

Free usenet access at
http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc