rule based on part of the name a file

  • Thread starter Thread starter Rossella
  • Start date Start date
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??
 
Sub SendFile()
With ActiveWorkbook
Select Case True
Case .Name Like "*001"
.SendMail "(e-mail address removed)"
Case .Name Like "*002"
.SendMail "(e-mail address removed)"
'etc
End Select
End With
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
I would think that
Case .Name Like "*001*"

may be better (as many spots as necessary)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top