A
Arnie
hi folks i have been able to read in a file name but i want to extract from
it (in this instance "need" the format is always
Word1_Word2_Word3_Word4_Word5.xls
i can get rid of the .xls but i need to extract the "Word4" from the file name
code below gets me the filename then i need to split that
any ideas?
ta in advance
Dim intPos As Integer
Dim intPosSave As Integer
intPos = 1
Do
intPos = InStr(intPos, strFile, "\")
If intPos = 0 Then
Exit Do
Else
intPos = intPos + 1
intPosSave = intPos - 1
End If
Loop
GetFileName = Trim$(Mid$(strFile, intPosSave + 1))
Word4= GetFileName
Word4= Replace(Site, ".xls", "", , -1)
it (in this instance "need" the format is always
Word1_Word2_Word3_Word4_Word5.xls
i can get rid of the .xls but i need to extract the "Word4" from the file name
code below gets me the filename then i need to split that
any ideas?
ta in advance
Dim intPos As Integer
Dim intPosSave As Integer
intPos = 1
Do
intPos = InStr(intPos, strFile, "\")
If intPos = 0 Then
Exit Do
Else
intPos = intPos + 1
intPosSave = intPos - 1
End If
Loop
GetFileName = Trim$(Mid$(strFile, intPosSave + 1))
Word4= GetFileName
Word4= Replace(Site, ".xls", "", , -1)