Creating Trainees with macros
Hi David,
Try this
Sub NewSheet()
Dim ans
Dim cRows As Long
ans = InputBox("Supply sheet name", "Add Worksheets")
If ans < "" Then
Worksheets.Add after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = ans
cRows = Worksheets(1).Cells(Rows.Count, "A").End(xlUp).Row + 1
Worksheets(1).Hyperlinks.Add Anchor:=Worksheets(1).Range("A" &
cRows), _
Address:="", _
SubAddress:="'" & ans & "'!A1", _
TextToDisplay:=ans
Worksheets(1).Activate
End If
End Sub
--
HTH
RP
"David B." wrote in message
...
(I am currently in the Navy, onboard the USS Stennis)I am
having a problem creating a macro that allows others (who
are not excel smart) to enter a new name. This name
would then be posted on a new worksheet tab along with
the name being entered onto the front page (to be
hyperlinked to its coresponding worksheets (based on the
name)
For example:
The user runs the macro. It prompts the user to enter a
name (say john). The macro then creates
WKSHTS: John, John(1), John(2). and on the home page the
name John is entered to be hyperlinked to the
worksheet "John". (There are at least 40 wkshts) The
problem is I am leaving my command soon. I have done all
of the changes myself w/o macros (i just learned about
them). However, my replacement is not excel smart. I
have tried to explain to him what to do (even tried to
write out the instructions) with no avail. I created
this program and my CO wants to keep it running w/o me.
I thank you very much for your time.
|