Consulting

Results 1 to 2 of 2

Thread: Emailing disjoint cells

  1. #1
    VBAX Newbie
    Joined
    Nov 2007
    Location
    Fairbanks, AK
    Posts
    5
    Location

    Emailing disjoint cells

    Howdy,

    I've created an email button on an Excel 2003 spreadsheet to email a few
    cells when pressed, using the following code I got from the KB:

    'Select the range of cells on the active worksheet
    ActiveSheet.Range("NeededHAGO", "NeededNAPTHA").Select

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

    'Set the optional introduction field that 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 = "GVEA Fuel Needs:"
    .Item.To = "LJRoberts(at)gvea.com"
    .Item.Subject = "GVEA Fuel Needs"
    .Item.Send
    End With

    It works great, except that those ranges are disjoint and there are a few
    cells in between them that are also being sent. I've tried to use
    Application.Union in various ways, but when those ways did work, they ended
    up sending the whole sheet. Any ideas?
    Lance Roberts
    Control Systems Engineer
    Golden Valley Electric Assoc.

  2. #2
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    Copy the cells that you want to a different sheet and mail that sheet.

Posting Permissions

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