View Single Post
  #5   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 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.