View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Biff
 
Posts: n/a
Default Cells as checkboxes?

P.S.

If I reduce the font size to say, 8, the row height does not change but then
the "checkmark" is too small.

Biff

"Bob Phillips" wrote in message
...
Hi Austin,

Try this technique that I have posted previously of having a check column,
and monitoring it with a worksheet selection change event. Add your code
as
needed.

Rather than use a checkbox, I suggest just using a check column. So if we
assume that the data is in A1:E100 (change to suit), clicking in column A
will do what you want with this code.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo sub_exit
If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
With Target
If .Value = "a" Then
.Value = ""
Else
.Value = "a"
.Font.Name = "Marlett"
End If
End With
End If
sub_exit:
Application.EnableEvents = True
End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.




--

HTH

RP
(remove nothere from the email address if mailing direct)


"Austin" wrote in message
...
Hi, I need to either

a) put a checkbox into a cell (which I don't think is possible) or
b) make the cell itself act as a click-able checkbox

The reason is that I want the checkboxes themselves to appear and/or
disappear as a result of a conditional "IF" statement selected elsewhere

on
the spreadsheet.

Any ideas?

Thanks