Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXCEL - Selct a list of names with radio button, then email them

Status
Not open for further replies.

adamf

Technical User
Mar 7, 2002
51
0
0
GB
I am trying to create a fault reporting form in excel, that depending on the nature of the fault needs to be emailed to any number of people.

I have a list of all the people who may need to be mailed the report, but wonder if anyone can help me to:

1) Add a tick-box or radio button to each name in the list

2) Write a macro that on the push of a button, emails the report to eveyone whose name has been ticked

EG. This should send the report to Adam, Bill & John, but NOT Fred or Mike

Adam [x]
Bill [x]
Fred [ ]
John [x]
Mike [ ]

Thanks in advance.

Adam

Adam F
Solaris System Administrator
 


Hi,

I'd use the AutoFilter to filter the selections and then this function to return a list that can be used in the TO...
Code:
Function MakeList(rng As Range, Optional TK As String = "'", Optional CM As String = ",") As String
'SkipVought/2005 Jun 13/
'--------------------------------------------------
' Access: N/A
'--------------------------------------------------
':this function returns a single-quoted list that can be used, for instance _
in an IN Clause in SQL _
"WHERE PART_ID IN (" & MakeList([SomeRange]) & ")" _
Pass other delimeter or list separator value as needed.
'--------------------------------------------------
    Dim r As Range
    
    For Each r In rng.SpecialCells(xlCellTypeVisible)
        With r
            MakeList = MakeList & TK & Trim(.Value) & TK & CM
        End With
    Next
    MakeList = Left(MakeList, Len(MakeList) - 1)
End Function


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top