Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
differentiating between checkboxes
I am trying to accomplish the following using checkboxes on a userform
1. Scan all the check boxes (there are currently 5, 4 with email addresses) 2. Create a string with the email addresses in the checkboxes that are checked i am doing this by looking for the "@" in the string The code below is doing that EXCEPT it is also picking up the string from the non email checkbox It is operating from a command button Sub SendEmailBtn_Click() Dim CBCtrl As MSForms.Control Dim RBCtrl As MSForms.Control Dim strReceipients As String Dim MsgBody As String 'check to see what checkboxes are checked and add that email to the string in recipients For Each CBCtrl In RndmemailFrm.Controls 'If TypeOf CBCtrl Is MSForms.CheckBox Then If TypeName(CBCtrl) = "CheckBox" Then If CBCtrl.Object.Value = True Then If InStr(Ctrl.Caption, "@") 0 Then strReceipients = strReceipients & ";" & CBCtrl.Caption End If End If End If Next MsgBox strReceipients End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Differentiating Case Sensitivity in a Vlookup | Excel Discussion (Misc queries) | |||
Help differentiating numbers and dates | Excel Discussion (Misc queries) | |||
Differentiating Cell Drag Copy | Excel Programming | |||
differentiating between formulas and values | Excel Discussion (Misc queries) | |||
differentiating between "and"/"or" in a formula | Excel Worksheet Functions |