Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to add filter to email macro

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 = "
.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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How to add filter to email macro

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


wrote in message ups.com...
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 = "
.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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Macro how to create email link for the email addresses in aRange or Selection Satish[_2_] Excel Worksheet Functions 8 December 28th 09 03:30 PM
How do I create an email macro to auto fill the email? Justin[_4_] Excel Discussion (Misc queries) 0 November 14th 07 10:49 PM
Using Advanced Filter to extract email addresses Frank Wood Excel Discussion (Misc queries) 4 March 1st 07 10:54 PM
filter email addresses Angel Excel Discussion (Misc queries) 3 August 20th 06 12:41 PM
Filter out bad email addresses Chris W. Excel Programming 1 March 2nd 05 05:40 AM


All times are GMT +1. The time now is 03:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"