Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 91792

Unable to code VBA for Mailto and Hyperlinks

$
0
0

Just to get things out of the way, its my 1st time doing this type of coding FYI.

Ok so here is the prob:

I am using excel 2010

I am trying to create a hyperlink that includes a mailto in it to create emails with hardly any need to type things in.

Currently I am using the following formula: =HYPERLINK("mailto:"&C25&"&cc="&C26&"?subject="&C16&"&body="&C2,"SendEmail")

The problem is that once everything gets evaluated the hyperlink function exceeds 256 characters. I was thinking of writing a VBA code to get around this but I have never done any VBA coding.

I found the following code but I am not sure how I can implement this as a solution to my problem:


    Dim curCell As Range
    Dim longHyperlink As String

    Set curCell = Range("C31")   ' or use any cell-reference
    longHyperlink = "C30"' Or a Cell reference like [C1]

    curCell.Hyperlinks.Add Anchor:=curCell, _
                    Address:=longHyperlink, _
                    SubAddress:="", _
                    ScreenTip:=" - Click here to follow the hyperlink", _
                    TextToDisplay:="Long Hyperlink"

End Sub

Any feedback or help would be much appreciated.


Viewing all articles
Browse latest Browse all 91792

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>