View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default email and radio buttons

matt -

use the control toolbox to add the radio button (also called an option
button) on each sheet, it will initially be set as false & will be
entitled "option button 1".
if you double-click on it, it will bring you to something like

Option Explicit

Private Sub OptionButton1_Click()

End Sub

this private sub is in the WORKSHEET module. then you can write your
e-mail sending program in a regular module, say

public sub send_email_now()

blah blah blah (i know NOTHING about e-mail coding!)

end sub


then in the sheet module private sub you would add:


Option Explicit

Private Sub OptionButton1_Click()

Call send_email_now

set optionbutton1.value=false

End Sub

the option button is connected to THAT specific sheet. so whatever
sheet is triggering the option button will send only that sheet (i'm
pretty sure).
then you have to make sure you unselect the option button.

do this for each worksheet......... you will have 3 private sheet
codes & one public regular module code. each sheet code will call the
send_email_now code.
when somebody clicks on the option button, they will HAVE to have that
worksheet open, so you can use activesheet.

hope this helps!
susan




On Mar 20, 8:10 am, Matt T <Matt
wrote:
I have three worksheets in a workbook; using a userform to administer them I
would like to email independantly a sheet (this I understand using SendMail)
BUT I would like the VBA code to look at which radio button has focus and
email the correct sheet.

Any help appreciated, I am essentially a newbie with only basic skills...

Matt