SysChat is a free online computer support community. Ask questions, share resources, contribute knowledge and discuss technology. Join our growing community to access all features. Register Now!

SysChat » Software Support » General Software » Excel: Prohibit special character entry into a cell

General Software

Support and discuss general software, applications, utilities, tips etc.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 05-19-2009, 03:53 PM
jowilla442 jowilla442 is offline
Junior Member
 
About:
Join Date: May 2009
Posts: 5
jowilla442 is on a distinguished road

Page Excel Excel: Prohibit special character entry into a cell


I have a cell that will be used for a filename when the user closes Excel.

I need to either:

1. Prohibit special characters from being entered into the cell. -Or-
2. Only allow all other characters besides the special characters to be entered into the cell by the user.

Can anyone help?? This is driving me crazy!!!!!

THANKYOU!!



Reply With Quote
  #2 (permalink)  
Old 05-20-2009, 02:25 PM
jowilla442 jowilla442 is offline
Junior Member
 
About:
Join Date: May 2009
Posts: 5
jowilla442 is on a distinguished road

Default Replace special characters with ""


Another option would be to replace special characters with something else.

I have a macro that the users execute by clicking a graphic that changes the filename to the cell in question after they fill out the form.

If I could put some code in there that detected special characters and replaced them with something else, that would work too.

Appreciate any help!!!



Reply With Quote
  #3 (permalink)  
Old 05-20-2009, 02:59 PM
William_Wilson's Avatar
William_Wilson William_Wilson is offline
Moderator
 
About:
Join Date: Mar 2006
Location: Canada
Posts: 973
William_Wilson has a spectacular aura aboutWilliam_Wilson has a spectacular aura aboutWilliam_Wilson has a spectacular aura about

Default


I don't know if you can do this with excel, but couldn't you do this within your macro before saving? Prompt the user if the filename is invalid, or simply replace the unacceptable characters.



__________________

</Dream In Code>
-William. § (marvin_gohan)
Reply With Quote
  #4 (permalink)  
Old 05-20-2009, 03:39 PM
jowilla442 jowilla442 is offline
Junior Member
 
About:
Join Date: May 2009
Posts: 5
jowilla442 is on a distinguished road

Default Replace invalid filename characters


Thanks for your reply William,

Either would be acceptable, I'm just not sure how to do it... (I'm not a very good programmer - I'm actually just an electrician who got roped into making this spreadsheet because I worked with computers in one of my past lives)...

Here's the macro I have so far. This is executed after the user fills out a form and clicks on a graphic:

Sub SaveFile()

Dim FName As String
Dim FPath As String

FPath = "C:\SCI_REPORTS"
FName = Sheets("SCI REPORT").Range("D3").Text
ThisWorkbook.SaveAs Filename:=FPath & "\" & FName

Call Shell("C:\SCI_REPORTS\UTILITIES\SCI_XFR_621.bat", vbNormalFocus)
Call Shell("C:\SCI_REPORTS\UTILITIES\ExcelExit.bat", vbNormalFocus)

End Sub


If I could tweak this to prompt the user or just replace the invalid characters (preferrably just replace the invalids). I'd be home free!

Thanks again!
-John



Reply With Quote
Reply





Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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



» Ads



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54