View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jamie Jamie is offline
external usenet poster
 
Posts: 191
Default Sending an email

Hi There

I have the following code to send an email when a button is clicked:

Sub Mail_workbook_1()
ActiveWorkbook.SendMail ", _
"EIS - Feeback Form"
ActiveWorkbook.Close False

End Sub

I would like to be able to change the address that the email is sent to
based on a cell value.

At the moment I have an if statement in Q4 that says
",if(a1="MrB","MrB@C ompanyB.com")

so basically if Mr A is selected in A1 when the macro runs it will send th
eemail to Mr A's address and if Mr B is in A1 then it will send to Mr B's
address.

Any help on this would be greatly appreciated.

Thanks in advance

Jamie