LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Removing invalid characters from proposed sheet name

that is pretty limited

Try something like this: In the Worksheets Change event put in this code

Private Sub Worksheet_Change(ByVal Target As Range
Set isect = Application.Intersect(Target, Range("a1")
If Not isect Is Nothing and Target.Value < "" The
for x = 1 to Len(Target.Value
If Mid(Target, x,1) Not Like "[A-Za-z0-9]" the
Msgbox "Use Letters and Numbers Only!
Target.Selec
Target.Value=""
End I
End i
End Sub
----- Bob Flanagan wrote: ----


newName = Application.Substitute(activecell.value, "/", ""

Bob Flanaga
Macro System
http://www.add-ins.co
Productivity add-ins and downloadable books on VB macros for Exce

"Ron McCormick" wrote in messag
..
I am wanting to enter data on a sheet and then rename the sheet as th

cell contents of a particular cell on the sheet. by programmaticall
pasting the cell contents as the sheetname. Trouble is the contents of th
sheet are set by users and they have used chracters such as / or \ withi
the cell. Is there a simple way of removing such characters
TI




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing 2-3 characters at the end Ty Excel Worksheet Functions 7 June 11th 11 01:41 AM
Removing characters Maksko Excel Discussion (Misc queries) 8 November 3rd 06 11:26 AM
Removing characters Maksko Excel Discussion (Misc queries) 7 October 19th 06 02:26 PM
Formula to replace invalid filename characters tschultz Excel Worksheet Functions 2 January 27th 06 07:07 PM
Invalid characters in Excel Andy Excel Programming 3 December 4th 03 04:34 PM


All times are GMT +1. The time now is 06:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"