PDA

View Full Version : [SOLVED:] Worksheet tabs



vmctsd
01-20-2005, 10:21 AM
:banghead: I would like my worksheet tabs to automatically populate with data in a worksheet cell. Has anyone written code or have a suggestion for accomplishing this?

Zack Barresse
01-20-2005, 10:51 AM
Hi there, welcome to VBAX!


You could try something like this ...


Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Target.Address = "$A$1" Then '<<-- CHANGE
Me.Name = Target.Value
If Err <> 0 Then
MsgBox "Please enter a name, and no special characters!"
Err.Clear
End If
End If
End Sub

Right click your sheet tab and select View Code. Paste on right. HTH

vmctsd
01-20-2005, 11:05 AM
Wow Firefytr, you are the programmer!!! That worked great. Thanks for the solution and the welcome. This is a great site!!

:cloud9:

Zack Barresse
01-20-2005, 11:10 AM
LOL! Thanks! :D

Glad it worked for you! As far as the solution goes, maybe we should make that a Knowledge Base entry.. Great idea!! :yes

Btw, did you know you can mark your own threads Solved? Go to Thread Tools --> Mark Solved --> Perform Action. This is possible because of Mark007 who programmed it for us!