View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
steveB steveB is offline
external usenet poster
 
Posts: 30
Default CODE FOR CHECK BOXES, AND EXCEL AS ATTACHMENT !

Jay,

Frank Kabel has given you an excellent site for sending emails.

Now for the check box...
Instead of using a check box - use a change event. You can add formatting
and other stuff...

This will work when $A$1 is selected.
'''''''''''''''''''
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$1" Then
If Len(Target) = 0 Then
Target.Formula = "X"
Else: Target.ClearContents
End If
End If
End Sub
'''''''''''''''''
And this one will work when $A$1 is double clicked
''''''''''''''''
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Address = "$A$1" Then
If Len(Target) = 0 Then
Target.Formula = "X"
Else: Target.ClearContents
End If
End If
Target.Offset(1, 0).Activate
End Sub
'''''''''''''''''''''''
hth
--

steveB

(Remove 'NOSPAM' from email address if contacting me direct)


"jay dean" wrote in message
...
2 questions:
(1) I have created a check box in a worksheet using the visual basic
toolbar (not forms). I need a code to assign to the check box such that
when clicked on, the check box displays "X" instead of a check mark, and
when clicked on again it displays nothing. In other words when clicked
on, the check box should toggle between "X" and not showing anything.

(2) I need a code that will attach the current workbook (say
WorkbookA.xls) as an e-mail attachment. I use microsoft outlook. The
"TO:" field of the e-mail should contain two addresses like
" and " and the subject line of the e-mail
should contain a subject like "Hello World!". The body of the e-mail
should contain a message like "Thank you for your participation". All of
the above must be done automatically.
Any help would be greatly appreciated. Thanks in advance!
Jay Dean


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!