Sending an email

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi There

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

Sub Mail_workbook_1()
ActiveWorkbook.SendMail "(e-mail address removed)", _
"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="MrA","(e-mail address removed)",if(a1="MrB","(e-mail address removed)")

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
 
Hi
Sub Mail_workbook_1()
ActiveWorkbook.SendMail activesheet.range("Q4").value, _
"EIS - Feeback Form"
ActiveWorkbook.Close False

End Sub
 

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