Gets only the file name minus the extention of a file name.
Gets only the file name minus the extention of a file name.
Rate Gets only the file name minus the extention of a file name.
(1(1 Vote))
Dim i As Long
For i = 0 To Len(FileName)
If Right(Left(FileName, i), 1) = "." Then
If WithDot = False Then
GetFileName = Left(FileName, i - 1)
Else
GetFileName = Left(FileName, i)
End If
Exit Function
End If
Next
End Function
---=== How to Use ===---
' To get the file name with the dot at the right
variable = GetFileName(FILENAME, True)
' To get the file name without the dot at the right
variable = GetFileName(FILENAME, False)
Gets only the file name minus the extention of a file name. Comments
No comments yet — be the first to post one!
Post a Comment