rule based on part of the name a file

R

Rossella

Hi all,
I've to send a different file(but they could be even 2 or 3) to 15
people..
the rule should be like
if filename contains ...0001(the filename is 0001-- send it to...
0002..send it to...
and so on..
is it possible??
Rossella

ps is there some good website for learning vba for excel??
 
B

Bob Phillips

Sub SendFile()
With ActiveWorkbook
Select Case True
Case .Name Like "*001"
.SendMail "[email protected]"
Case .Name Like "*002"
.SendMail "[email protected]"
'etc
End Select
End With
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
D

Dave Peterson

I would think that
Case .Name Like "*001*"

may be better (as many spots as necessary)
 
Top