+ Reply to Thread
Results 1 to 2 of 2

Issue sending email with range in subject to different emails based on link selected

  1. #1
    Registered User
    Join Date
    09-15-2021
    Location
    Virginia, USA
    MS-Off Ver
    2016
    Posts
    2

    Issue sending email with range in subject to different emails based on link selected

    I found this thread that had the code that worked just fine for me...except
    excel-general/1080328-hyperlink-mailto-email-that-will-deliver-cell-range-results

    however, I am trying to have three cells with links that I can send the exact same range to different email based on the link I clicked.

    I have tried to add a number after the such as: Private Sub Worksheet_FollowHyperlink1 and past the new code below with a 2 etc. however when I do that all the links do nothing.

    This is my first time using VBA I tried a basic formula however, from my research you can not past a range in the email subject.

    I would also be willing to use one link vs. three and just have the to line blank. I tried to no put an email in the to line and all I got was the range pasted in the to line on the email.

    My links reference back to themselves and are in cells AA5, AB5, AC5 and the range I am trying to copy is AA6:AF144

    Below is the code i can get to work for the first thread

    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
    Select Case Target.Range.Address
    Case "$AA$5"
    Range("AA6:AF143").Copy

    Dim OutApp As Object
    Dim OutMail As Object

    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)

    On Error Resume Next
    With OutMail
    .To = "email"
    .CC = ""
    .BCC = ""
    .Subject = "Vessel Update"
    .Display
    End With
    OutMail.Subject.Activate
    Application.SendKeys "^v"
    On Error GoTo 0
    Set OutMail = Nothing
    End Select
    Last edited by yancy350; 10-05-2021 at 09:13 PM. Reason: Adding info

  2. #2
    Registered User
    Join Date
    09-15-2021
    Location
    Virginia, USA
    MS-Off Ver
    2016
    Posts
    2

    Re: Issue sending email with range in subject to different emails based on link selected

    I am new so it wont let me post the code I have used...

    I had to remove the actual email address from the code so I replaced it with Email
    Last edited by yancy350; 10-05-2021 at 09:14 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Outlook, rename subject of selected emails, VBA
    By dude6571 in forum Outlook Programming / VBA / Macros
    Replies: 6
    Last Post: 05-16-2023, 08:04 AM
  2. Outlook, rename subject of selected emails, VBA
    By dude6571 in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 10-22-2018, 06:17 AM
  3. Forward Email Based on Selected Object's Subject and/or Sender and Recipient Address
    By Citanaf in forum Outlook Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2015, 07:38 PM
  4. [SOLVED] excel userform to show emails on selected subject from listbox
    By Megatronixs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2015, 02:46 PM
  5. need to have macro that emails the workbook, adds in subject and body to email
    By CityInspector in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-17-2013, 02:57 PM
  6. Outlook - prevent sending of emails without a subject matter
    By ErnieLaboy in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 01-04-2013, 12:40 PM
  7. [SOLVED] Email Range of Cell Content to create subject and body from link
    By Hahndo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2005, 07:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1