How to add filter to email macro

K

kevin.marchand

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 address removed);[email protected];[email protected]"
.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
 

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