ok,i think this is really simple, i have a string e.g.
.xls Excel File
what i would like to do is extract just the xls part, how can i do this so i read from the second cha=racter position until i find a space and retrieve the info in between?
Printable View
ok,i think this is really simple, i have a string e.g.
.xls Excel File
what i would like to do is extract just the xls part, how can i do this so i read from the second cha=racter position until i find a space and retrieve the info in between?
Hi
You can use Mid() and Instr() in tandem. Like,
Mid(fileString,2,Instr(1,fileString," ",vbTextCompare)-1 would do the job.
where
Mid() is a function retrieves a part of the string
Instr() gets the position of the specfic character/string
fileString is a variable holding your file name & details.
2 starts from the second character
-1 till the previous character (just before the space)
Gs
dude, many thanks, will try it out now. Thank God for VBFourms!