Creating a Check Box within a Cell (

F

Femi

Please pardon my ignorance on Programming (I am an accountant)
I need help creating a Check Box within a cell so when I double click on
that cell the check mark appears. I need to be able to copy the code to
other cells as well. Please be very detailed.

Thanks

Please Note:
I already tried inserting the Check Box thru the developer Control menu, but
it not locking into the cell I was told I would have to write a code through
Visual Basic to get it to do what I want.
 
J

John

Hi
You could select Marlett as a font in the cells you like to have a check
mark and by typing the letter "B" you will get a check marck. Since its a
font you can size it or colour it.
HTH
John
 
G

Gary''s Student

Expanding on John's Marlett idea, here is an event macro for the cell in
column A

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Set t = Target
Set a = Range("A:A")
If Intersect(t, a) Is Nothing Then Exit Sub
Cancel = True
If t.Value = "" Then
t.Value = "a"
t.Font.Name = "Marlett"
Else
t.Value = ""
End If
End Sub


Because it is worksheet code, it is very easy to install and automatic to use:

1. right-click the tab name near the bottom of the Excel window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you have any concerns, first try it on a trial worksheet.

If you save the workbook, the macro will be saved with it.


To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top