PC Review


Reply
Thread Tools Rate Thread

How to add filter to email macro

 
 
kevin.marchand@gmail.com
Guest
Posts: n/a
 
      10th Apr 2007
Hello,

I am using the following macro to email a range of cells (embedded in
the body of the email) as well as publish that range to an .htm file:

===================================================
Sub PostEmailWebpage()
' Select the range of cells on the active worksheet.
ActiveSheet.Range("A3:F33").Select

' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True

' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.
With ActiveSheet.MailEnvelope
'.Introduction = "This is a sample worksheet."
.Item.To = "(E-Mail Removed);(E-Mail Removed);(E-Mail Removed)"
.Item.Subject = "[ Critical Systems Status Update ]"
.Item.Send
End With

Dim wb As Workbook
Set wb = ActiveWorkbook
'Do what you want with workbook here, using wb variable
'Then save the range A1:C6 as an html document without interactivity
With wb.PublishObjects.Add(xlSourceRange, _
"\\x\x\update.htm", "Post", "$A$3:$F$26", _
xlHtmlStatic, "Book1_20936")
..Publish (True)
End With
End Sub
===================================================

It works perfectly well but I would like to add one small bit of
functionality;

I would like the email to only include the rows IF the value in column
C of that row is NOT 1.

Any suggestions for how to accomplish that would be greatly
appreciated.

Thanks.
Kevin

 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      10th Apr 2007
You can send the visible cells Kevin like this
http://www.rondebruin.nl/mail/folder3/mail4.htm

--

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


<(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> Hello,
>
> I am using the following macro to email a range of cells (embedded in
> the body of the email) as well as publish that range to an .htm file:
>
> ===================================================
> Sub PostEmailWebpage()
> ' Select the range of cells on the active worksheet.
> ActiveSheet.Range("A3:F33").Select
>
> ' Show the envelope on the ActiveWorkbook.
> ActiveWorkbook.EnvelopeVisible = True
>
> ' Set the optional introduction field thats adds
> ' some header text to the email body. It also sets
> ' the To and Subject lines. Finally the message
> ' is sent.
> With ActiveSheet.MailEnvelope
> '.Introduction = "This is a sample worksheet."
> .Item.To = "(E-Mail Removed);(E-Mail Removed);(E-Mail Removed)"
> .Item.Subject = "[ Critical Systems Status Update ]"
> .Item.Send
> End With
>
> Dim wb As Workbook
> Set wb = ActiveWorkbook
> 'Do what you want with workbook here, using wb variable
> 'Then save the range A1:C6 as an html document without interactivity
> With wb.PublishObjects.Add(xlSourceRange, _
> "\\x\x\update.htm", "Post", "$A$3:$F$26", _
> xlHtmlStatic, "Book1_20936")
> .Publish (True)
> End With
> End Sub
> ===================================================
>
> It works perfectly well but I would like to add one small bit of
> functionality;
>
> I would like the email to only include the rows IF the value in column
> C of that row is NOT 1.
>
> Any suggestions for how to accomplish that would be greatly
> appreciated.
>
> Thanks.
> Kevin
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
KB981432 Junk Email Filter update for Outlook 2003 causes filter f improved_cylinder Microsoft Outlook Discussion 1 15th Apr 2010 07:21 PM
Using Macro to Open Filter by form, clear grid, then run filter Victoria@DIG Microsoft Access Macros 0 20th Apr 2008 12:46 AM
Junk Filter waits til I select an email to filter it in IMAP accou =?Utf-8?B?Sm9lbCBC?= Microsoft Outlook Discussion 3 2nd Oct 2006 12:50 PM
Need macro to filter, create tab on filter and copy/paste Jen Microsoft Excel Programming 1 2nd May 2006 04:45 PM
Need macro to filter, create tab on filter and copy/paste Jen Microsoft Excel Programming 1 2nd May 2006 04:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:44 PM.