Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub SheetNameActivecell()
Dim BadSym(6) BadSym(1) = "/" BadSym(2) = "\" BadSym(3) = "?" BadSym(4) = "[" BadSym(5) = "]" BadSym(6) = "*" NewName = ActiveCell.Value 'MsgBox NewName For k = 1 To 6 NewName = Replace(NewName, BadSym(k), "") 'MsgBox NewName Next k Application.ActiveSheet.Name = Left(NewName, 31) End Sub best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "al" wrote in message ... I'm currently using macro below to remove / as invalid character and keep the character limit to 31. However i would also like to add the other invalid characters ? \ [ ] * so that i can provide for more invalid characters - Pls help thxs Sub SheetNameActivecell() Application.ActiveSheet.Name = Left(Application.Substitute (ActiveCell.Value, "/", ""), 31) End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do i rename a sheet if the rename tab is inactive? | Excel Worksheet Functions | |||
Removing character in a string | Excel Discussion (Misc queries) | |||
Removing a character | Excel Worksheet Functions | |||
In excell, I put an invalid character on a worksheet name tab, no. | New Users to Excel | |||
Removing invalid characters from proposed sheet name | Excel Programming |