Public Function GetDrive(Path As String) As String
Dim i As Integer Dim DriveLetterOnly As String For i = 1 To Len(Path) DriveLetterOnly = Left(Path, i) If Right(DriveLetterOnly, 1) = ":" Then DriveLetterOnly = Left(DriveLetterOnly, i - 1) GetDrive = DriveLetterOnly & ":" & "\" Exit Function End If Next End Function |