You should not need to make a new Function when the built in Replace() Function will probably get you where you want. Check it out and get back if it is not what you want.
You should not need to make a new Function when the built in Replace() Function will probably get you where you want. Check it out and get back if it is not what you want.
Thank You for Your answer.
Ha ha, while I was waiting for the answer I built the function that aready exists
I originally intended to check if the date holds "/" character and replace it.
Here's the function:
Code:
Dim datum As Date
Dim i As Integer
Dim strIsp As String
Dim strCur As String
Dim strFin As String
datum = FormatDateTime(Now(), vbShortDate)
For i = 1 To Len(datum)
strCur = Mid(datum, i, 1)
If strCur = "/" Or strCur = "." Then
strCur = "_"
End If
strIsp = strCur
strFin = strFin + strIsp
'MsgBox strFin
strCur = ""
Next i
MsgBox strFin
It is fun when you spend time creating something just to find out that a single line will do the work you just created using many lines of code. I've been there.