MessageBox

O

OrlaLynch

Hi-
I have a macro which sends an e-mail of a report to a certain person which
is triggered by a command prompt. My problem is that I would like to give my
user the option of who they want to send it to.

I have thought about a MessageBox with a text field which would be connected
to the macro but I don't know if this is possible?

Any ideas?
Thanks,
Orla
 
O

OrlaLynch

Thanks for your reply. I don't have code for a message box/input box yet but
this is how I am currently sending the email:

ThisWorkbook.Sheets("Report").Copy

With ActiveWorkbook

.SendMail Recipients:="(e-mail address removed)", Subject:="DAS Report " &
Format(Date, "dd/mmm/yy")

.Close SaveChanges:=False

End With


I hope you can help,
Thank you.
 
N

NateBuckley

Dim emailAddress As String
emailAddress = InputBox("Input Email Address you'd like to send", "Email
Address")


With ActiveWorkbook

.SendMail Recipients:=emailAddress, Subject:="DAS Report " &
Format(Date, "dd/mmm/yy")

.Close SaveChanges:=False

End With

Should work? Haven't tested it but will allow you to input an email address
and then use it in the SendMail Function (never used that before).

Hope this helps
 
O

OrlaLynch

That worked perfectly!

Thank you very much!

NateBuckley said:
Dim emailAddress As String
emailAddress = InputBox("Input Email Address you'd like to send", "Email
Address")


With ActiveWorkbook

.SendMail Recipients:=emailAddress, Subject:="DAS Report " &
Format(Date, "dd/mmm/yy")

.Close SaveChanges:=False

End With

Should work? Haven't tested it but will allow you to input an email address
and then use it in the SendMail Function (never used that before).

Hope this helps
 

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

Top