B
Brian P.
I have a simple macro, which the admin staff here will be using, that
has a drop-in box linked to a handful of seperate sheets (each sheet
is a seperate company), with each sheet having 15-20 clients.
The macro simply converts each email address to a hyperlinked mailto:
email address (when the email is a result of a formula it seems you
can't hyperlink to it), then I concatenate all the addresses,
seperated by a ",". Finally the macro selects this cell and opens up
a new, blank email.
The problem is that I can't have more than 11 email addresses in the
cell. It seems the excel-Lotus Notes don't like each other? It's
very annoying having to run the macro and copy-and-paste the addresses
from the first 11 recipeints and put them into the other blank
email.
Any assistance would be awesome. Thanks.
_________________________________________
Public Sub ConvertToMailLinks()
Const sPATTERN As String = "?*@?*.?*"
Dim vResult As Variant
Dim rCell As Range
Dim rCheck As Range
If TypeName(Selection) = "Range" Then _
If Selection.Count > 1 Then _
Set rCheck = Selection
If rCheck Is Nothing Then
vResult = MsgBox( _
Prompt:="Search the entire worksheet?", _
Buttons:=vbYesNo, _
Title:="Convert to MailTo: Links")
If vResult = vbYes Then
Set rCheck = ActiveSheet.Cells
Else
Set rCheck = ActiveCell
End If
End If
On Error Resume Next
Set rCheck = rCheck.SpecialCells(xlCellTypeConstants,
xlTextValues)
On Error GoTo 0
If Not rCheck Is Nothing Then
For Each rCell In rCheck
If rCell.Value Like sPATTERN Then _
ActiveSheet.Hyperlinks.Add _
anchor:=rCell, _
Address:="mailto:" & rCell.Value, _
TextToDisplay:=rCell.Value
Next rCell
End If
End Sub
Sub EmailGroup()
'
' EmailGroup Macro
' Macro recorded 01/31/2007 by BP
'
'
ActiveWindow.SmallScroll Down:=3
Range("E5,H27,H26").Select
Range("H26").Activate
Application.Run "'contact list.xls'!ConvertToMailLinks"
Range("H26").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
End Sub
has a drop-in box linked to a handful of seperate sheets (each sheet
is a seperate company), with each sheet having 15-20 clients.
The macro simply converts each email address to a hyperlinked mailto:
email address (when the email is a result of a formula it seems you
can't hyperlink to it), then I concatenate all the addresses,
seperated by a ",". Finally the macro selects this cell and opens up
a new, blank email.
The problem is that I can't have more than 11 email addresses in the
cell. It seems the excel-Lotus Notes don't like each other? It's
very annoying having to run the macro and copy-and-paste the addresses
from the first 11 recipeints and put them into the other blank
email.
Any assistance would be awesome. Thanks.
_________________________________________
Public Sub ConvertToMailLinks()
Const sPATTERN As String = "?*@?*.?*"
Dim vResult As Variant
Dim rCell As Range
Dim rCheck As Range
If TypeName(Selection) = "Range" Then _
If Selection.Count > 1 Then _
Set rCheck = Selection
If rCheck Is Nothing Then
vResult = MsgBox( _
Prompt:="Search the entire worksheet?", _
Buttons:=vbYesNo, _
Title:="Convert to MailTo: Links")
If vResult = vbYes Then
Set rCheck = ActiveSheet.Cells
Else
Set rCheck = ActiveCell
End If
End If
On Error Resume Next
Set rCheck = rCheck.SpecialCells(xlCellTypeConstants,
xlTextValues)
On Error GoTo 0
If Not rCheck Is Nothing Then
For Each rCell In rCheck
If rCell.Value Like sPATTERN Then _
ActiveSheet.Hyperlinks.Add _
anchor:=rCell, _
Address:="mailto:" & rCell.Value, _
TextToDisplay:=rCell.Value
Next rCell
End If
End Sub
Sub EmailGroup()
'
' EmailGroup Macro
' Macro recorded 01/31/2007 by BP
'
'
ActiveWindow.SmallScroll Down:=3
Range("E5,H27,H26").Select
Range("H26").Activate
Application.Run "'contact list.xls'!ConvertToMailLinks"
Range("H26").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
End Sub