ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   emailing everyone on the list (https://www.excelbanter.com/excel-programming/434842-emailing-everyone-list.html)

PaddyMac[_2_]

emailing everyone on the list
 
I want to email everyone on the list, rather than having to click on them one
by one with the following command button.

Private Sub cmdAdd_Click()
Dim i As Integer
For i = 0 To lstEmployees.ListCount - 1
If lstEmployees.Selected(i) = True Then
lstAttendees.AddItem _
lstEmployees.List(i)
lstEmployees.Selected(i) = False
End If
Next i
cmdRemoveAll.Enabled = True
End Sub

Any ideas.

Kindest regards

PaddyMac


Tim Williams[_2_]

emailing everyone on the list
 
Just remove the check on whether an employee item is selected or not.

Private Sub cmdAddAll_Click()
Dim i As Integer
For i = 0 To lstEmployees.ListCount - 1
lstAttendees.AddItem lstEmployees.List(i)
Next i
cmdRemoveAll.Enabled = True
End Sub

Tim


"PaddyMac" wrote in message
...
I want to email everyone on the list, rather than having to click on them
one
by one with the following command button.

Private Sub cmdAdd_Click()
Dim i As Integer
For i = 0 To lstEmployees.ListCount - 1
If lstEmployees.Selected(i) = True Then
lstAttendees.AddItem _
lstEmployees.List(i)
lstEmployees.Selected(i) = False
End If
Next i
cmdRemoveAll.Enabled = True
End Sub

Any ideas.

Kindest regards

PaddyMac




PaddyMac

emailing everyone on the list
 
On Oct 12, 2:42*pm, "Tim Williams" wrote:
*Just remove the check on whether an employee item is selected or not.

Private Sub cmdAddAll_Click()
* * Dim i As Integer
* * For i = 0 To lstEmployees.ListCount - 1
* * * * lstAttendees.AddItem lstEmployees.List(i)
* * Next i
* * cmdRemoveAll.Enabled = True
*End Sub

Tim

"PaddyMac" wrote in message

...



I want to email everyone on the list, rather than having to click on them
one
by one with the following command button.


Private Sub cmdAdd_Click()
* *Dim i As Integer
* *For i = 0 To lstEmployees.ListCount - 1
* * * *If lstEmployees.Selected(i) = True Then
* * * * * *lstAttendees.AddItem _
* * * * * * * *lstEmployees.List(i)
* * * * * *lstEmployees.Selected(i) = False
* * * *End If
* *Next i
* *cmdRemoveAll.Enabled = True
End Sub


Any ideas.


Kindest regards


PaddyMac- Hide quoted text -


- Show quoted text -


Tim

If works!

Many thanks.

Kindest regards

PaddyMac


All times are GMT +1. The time now is 10:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com