View Single Post
  #13   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, 11:07*am, GS wrote:
used his keyboard to write :





On Apr 21, 3:49 am, Paul Robinson
wrote:
Hi
You have put the code in the wrong place (re-read my original
reply:)). The worksheet module is for special kinds of procedures
called worksheet level procedures and respond to certain things you do
to the worksheet. You need to put the code into what is called a
general code module. In the VBE go to Insert on the toolbar then click
on Module. You will get a blank white screen. Paste the code into
there (and delete it from the worksheet module!).
regards
Paul
On Apr 20, 9:19 pm, " wrote:


Paul,


Thanks for the quick response. I copied the code you replied with
into the VBA editor and place it on the Master Sheet object. I saved
and then started to enter lastnames from B13 to B30. The names of the
Stud1 - Stud18 worksheets didn't change. Was there a part of your
code that I needed to edit or customize for my workbook? Oh, I am
using Excel 2007. Any suggestions?- Hide quoted text -


- Show quoted text -


Gentlemen,


I moved the code into it's own module and saved the workbook.
I then ran the Macro and recieved a "run-time error '9' Subscript out
of range"
I hit the "Debug" option and the VBE had the following line of code
highlighted:


Worksheets(Temp).Name = mycell.Value


Is there something wrong? *Again I appreciate all the help everyone
has put forth!


Brad


I forgot to include...

Are there 18 worksheets named "Stud1" through "Stud18"?

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted text -

- Show quoted text -


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