Try something like the following (untested)
fName = activeworkbook.name
For I = 1 to len(fName)
if mid(fname, i, 1) = "_" then
tempS = mid(fName, I+1
exit for
end if
next
for I = 1 to len(tempS)
if mid(temps, i,1) = "_" then
dateS = left(temps, i-1)
exit for
end if
next
msgbox dateS
Bob Flanagan
Macro Systems
144 Dewberry Drive
Hockessin, Delaware, U.S. 19707
Phone: 302-234-9857, cell 302-584-1771
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
"Pam" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I was wondering if anyone new exactly how to use the chop function
> to chop up a string. Basically what I am trying to do is chop up thre
> namer of
> a file which contains the filename with date. I want to get the date
> for that file
> name; Here is an example
>
> MY Sheet_070327_US.xls
>
> I want to chop it up so I just end up with the date.
>
>
>
> Your help is appreicated. Thanking you in advance
>
>
> Pam
>