tony.reynolds
Board Regular
- Joined
- Jul 8, 2010
- Messages
- 97
I have a userform that the user can enter a new name for the workbook so the original is kept
i obviously need to limit the user data to certain characters so "\" is not allowed and also the original file name is not allowed
if the current excel file name is XYZ that is not allowed.... and
how can I limit users from entering these characters? \ / : * ? " < > |
The following code i have allows text only but obviously dosnt stop user entering a number following a letter and the above characters. Stillit it will show you what im trying to do.
Anyons help would be appreciated
i obviously need to limit the user data to certain characters so "\" is not allowed and also the original file name is not allowed
if the current excel file name is XYZ that is not allowed.... and
how can I limit users from entering these characters? \ / : * ? " < > |
The following code i have allows text only but obviously dosnt stop user entering a number following a letter and the above characters. Stillit it will show you what im trying to do.
Code:
Private Sub NewFileName_Change()
If IsNumeric(NewFileName.Value) Then
MsgBox "cannot use ' \ / : * ? " < > |' characters"
NewFileName.Value = ""
End If
End Sub
Anyons help would be appreciated