ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CODE FOR CHECK BOXES, AND EXCEL AS ATTACHMENT ! (https://www.excelbanter.com/excel-programming/299564-code-check-boxes-excel-attachment.html)

Jay Dean

CODE FOR CHECK BOXES, AND EXCEL AS ATTACHMENT !
 
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!

Frank Kabel

CODE FOR CHECK BOXES, AND EXCEL AS ATTACHMENT !
 
Hi
for your second question see:
http://www.rondebruin.nl/sendmail.htm

--
Regards
Frank Kabel
Frankfurt, Germany


jay dean wrote:
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!


steveB

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!




Jay Dean

CODE FOR CHECK BOXES, AND EXCEL AS ATTACHMENT !
 

Thanks Steve and Frank for all your help.
I have one more question on the check box issue. It is for a survey so I
will need to create more check boxes. If I create check boxes using the
VB Toolbar (not forms) in my sheet, do they need extra coding to be
assigned for the check sign to toggle?
Thanks.

Jay Dean

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


All times are GMT +1. The time now is 03:47 PM.

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