Replace Space charcter in a string variable
Here is the code I used
-----------------------------------------
On Error Resume Nex
FileSaveName = Application.GetSaveAsFilename("K:\Excel_Keyword\",
fileFilter:="Text Files (*.txt), *.txt"
space_position = Application.WorksheetFunction.Find(" ", FileSaveName
If Err = 0 Then MsgBox "Spaces have been found in your file name," & vbCrLf &
"they will be replaced with underscores
Do While Err =
FileSaveName = Application.WorksheetFunction.Replace
(Arg1:=FileSaveName, Arg2:=space_position,
Arg3:=1, Arg4:="_"
space_position = Application.WorksheetFunction.Find(" ", FileSaveName
Loo
Err.Clea
|