Thread
:
Changing name of worksheet based on data in cell of another worksheet
View Single Post
#
18
Posted to microsoft.public.excel.programming
GS[_2_]
external usenet poster
Posts: 3,514
Changing name of worksheet based on data in cell of another worksheet
formulated the question :
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
Yeah, sorry about that! I was just appending a letter to each existing
name so I could test it. Change this line...
Sheets(sTemp).Name = sTemp & rng.Value
to...
Sheets(sTemp).Name = rng.Value
--
Garry
Free usenet access at
http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Reply With Quote
GS[_2_]
View Public Profile
Find all posts by GS[_2_]