Put this in your sheetChange event of your workshee
Private Sub Worksheet_Change(ByVal Target As Range
Dim cnt As Single, str As Strin
On Error Resume Nex
If Target.Cells.Count = 1 And
Not IsEmpty(Target) And
Target.Address = MyAddress Then '<< "$A$1
For cnt = 1 To Len(Target
str = Mid$(Target, cnt, 1
If Not str Like "[a-zA-Z0-9]" The
MsgBox "Invalid Sheet Name
Target.Value = "
Exit Su
End I
Nex
End I
End Su
----- Bhuktar S wrote: ----
I want to change sheet name as per a particular cell
Since the sheet name cannot accept special characters such as
: \ / * [ ] etc., if the user puts name in the cell with any of thes
characters, anywhere in the complete name, say, XYZ*2, error pops u
for debug. I want the user to avoid these characters to be used, b
validating the cell or by VBA code. (not by adding comment to th
cell
Could someone help me
--
Message posted from
http://www.ExcelForum.com