ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MessageBox (https://www.excelbanter.com/excel-programming/415329-messagebox.html)

OrlaLynch

MessageBox
 
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

dustinbrearton via OfficeKB.com

MessageBox
 
An input box or text box should be fine. Can you post some of your current
code and someone will surely be able to tell you what variable to use and
where to put it into your code.
OrlaLynch wrote:
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


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200808/1


OrlaLynch

MessageBox
 
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 ", Subject:="DAS Report " &
Format(Date, "dd/mmm/yy")

.Close SaveChanges:=False

End With


I hope you can help,
Thank you.


"dustinbrearton via OfficeKB.com" wrote:

An input box or text box should be fine. Can you post some of your current
code and someone will surely be able to tell you what variable to use and
where to put it into your code.
OrlaLynch wrote:
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


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200808/1



NateBuckley

MessageBox
 
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

"OrlaLynch" wrote:

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 ", Subject:="DAS Report " &
Format(Date, "dd/mmm/yy")

.Close SaveChanges:=False

End With


I hope you can help,
Thank you.


"dustinbrearton via OfficeKB.com" wrote:

An input box or text box should be fine. Can you post some of your current
code and someone will surely be able to tell you what variable to use and
where to put it into your code.
OrlaLynch wrote:
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


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200808/1



OrlaLynch

MessageBox
 
That worked perfectly!

Thank you very much!

"NateBuckley" wrote:

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

"OrlaLynch" wrote:

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 ", Subject:="DAS Report " &
Format(Date, "dd/mmm/yy")

.Close SaveChanges:=False

End With


I hope you can help,
Thank you.


"dustinbrearton via OfficeKB.com" wrote:

An input box or text box should be fine. Can you post some of your current
code and someone will surely be able to tell you what variable to use and
where to put it into your code.
OrlaLynch wrote:
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

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200808/1




All times are GMT +1. The time now is 05:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com