View Single Post
  #17   Report Post  
Posted to microsoft.public.excel.programming
[email protected][_2_] bss5974@yahoo.com[_2_] is offline
external usenet poster
 
Posts: 6
Default Changing name of worksheet based on data in cell of another worksheet

On Apr 21, 12:02*pm, GS wrote:
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 athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Garry,

We have success! However, it appends the name vice replacing it. Oh,
I used your revised code from the previous post. We are so close, and
you have been soo helpful. I was wondering if you could help me just
once more?

Brad