Results 1 to 15 of 15

Thread: Help sending a worksheet content in email body [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2005
    Posts
    32

    Resolved Help sending a worksheet content in email body [RESOLVED]

    Hi All,

    Basically I have a workbook which keeps track of how often a list of documents are reviewed. If a document's "Last reviewed date" falls beyond 180 days, conditional formatting turns the cell red to warn the owner.

    What I now want to be able to do is to automatically email the owner of those documents to tell them to take action. I've written the below but this will email the entire workbook to the user rather than just the contents (or a range thereof) of a worksheet.

    Can this be achieved? If so how?

    Many Thanks in advance

    Cliff


    VB Code:
    1. Private Sub MailDocument()
    2. 'This routene mails the customer
    3. Dim stDocName, User As String
    4. Dim MyMessage As Object
    5. User = "cliff@clifforddashwrightdotcodotuk"
    6. ColUpdateoverdue = 9
    7. For a = 2 To Sheets.Count
    8.         Sheets(a).Activate
    9.         For x = 3 To ActiveSheet.UsedRange.Rows.Count
    10.             If Sheets(a).Cells(x, ColUpdateoverdue) = "Yes" Then
    11.             With ThisWorkbook
    12.                '.HasRoutingSlip = False
    13.                 With .RoutingSlip
    14.                     .Delivery = xlAllAtOnce
    15.                     .Recipients = User
    16.                     .Subject = "These OSM Documents are due for review"
    17.                     .Message = Sheets(a).Cells(x, 8) & " Document " & Sheets(a).Cells(x, 1) & " is due for review"
    18.                     .ReturnWhenDone = False
    19.                    
    20.                 End With
    21.             .Route
    22.             End With
    23.          
    24.            'just for testing only    
    25.             MsgBox Sheets(a).Cells(x, 8) & " Document " & Sheets(a).Cells(x, 1) & " is due for review"
    26.             Else
    27.             End If
    28.         Next x
    29. Next a
    30.  
    31.  
    32.    
    33. End Sub
    Last edited by cliffw; Jun 19th, 2006 at 11:47 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width