Thread
:
Changing name of worksheet based on data in cell of another worksheet
View Single Post
#
6
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
wrote :
On Apr 20, 1:59*pm, GS wrote:
Post the revised code!
Also, put/move the code into a standard module. To create a standard
module, right-click the project in the Project Explorer and choose
InsertModule.
--
Garry
Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Garry,
In my initial description of the problem I made a mistake. It should
have read like this...
"The lastname in Cell B13 of the Master worksheet is for the Stud1
worksheet, and B14 for Stud2 and so on."
My revised code was this:
Sub ChangeTabNames()
Dim myNames As Range, mycell As Range
Dim Temp As String, i As Integer
Application.ScreenUpdating = False
Set myNames = Worksheets("Input Sheet").Range("B13:B30")
i = 1
For Each mycell In myNames
Temp = "Stud" & i
Worksheets(Temp).Name = mycell.Value
i = i + 1
Next mycell
End Sub
The only thing I changed from the originally posted code was the name
of the "Master" to "Input Sheet". Other than that, it is exactly as
posted earlier from Paul.
That looks fine!
So.., did you move the code to a standard module so it's accessible in
the Macros dialog?
--
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_]