ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   E-mail a worksheet, then auto open another and do the same by valueof a cell (https://www.excelbanter.com/excel-programming/430874-e-mail-worksheet-then-auto-open-another-do-same-valueof-cell.html)

Michael Lanier

E-mail a worksheet, then auto open another and do the same by valueof a cell
 
Can I, by the value of a cell in Sheet1, force multiple worksheets to
open, e-mail the sheet, close and perform the same set of events from
one worksheet to the next? I am using the following macro to get the
first sheet to open and e-mail a copy of itself:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveWorkbook.Worksheets("Sheet1").Range("O8").Va lue = 1 Then
ActiveWorkbook.Worksheets("Sheet1").Copy
ActiveWorkbook.SendMail Worksheets("Sheet1").Range("O9"),
Worksheets("Sheet1").Range("L4")
ActiveWorkbook.Close False
End If
End Sub

O8 is the trigger that initiates the event
O9 is the recipient's e-mail address
L4 is an accompanying message in the title of the message

Thanks for any help anyone can provide.

Michael

Ron de Bruin

E-mail a worksheet, then auto open another and do the same by value of a cell
 

Maybe this ?
http://www.rondebruin.nl/mail/folder1/mail5.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Michael Lanier" wrote in message
...
Can I, by the value of a cell in Sheet1, force multiple worksheets to
open, e-mail the sheet, close and perform the same set of events from
one worksheet to the next? I am using the following macro to get the
first sheet to open and e-mail a copy of itself:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveWorkbook.Worksheets("Sheet1").Range("O8").Va lue = 1 Then
ActiveWorkbook.Worksheets("Sheet1").Copy
ActiveWorkbook.SendMail Worksheets("Sheet1").Range("O9"),
Worksheets("Sheet1").Range("L4")
ActiveWorkbook.Close False
End If
End Sub

O8 is the trigger that initiates the event
O9 is the recipient's e-mail address
L4 is an accompanying message in the title of the message

Thanks for any help anyone can provide.

Michael



Michael Lanier

E-mail a worksheet, then auto open another and do the same byvalue of a cell
 
Thanks Ron. I'll be trying it later today, but from what I can tell,
it looks to be what I'm looking for.

Michael


All times are GMT +1. The time now is 10:07 AM.

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