Add or Delete borders of a cell by clicking on that cell

  • Thread starter Thread starter Happy Proby
  • Start date Start date
H

Happy Proby

I have a form that one must manually "circle" either "YES' OR "NO" each in
thier own cell. doesnot need to be a circle but could be a colored square
border.
Can anyone help?
Thanks
Happy Proby
 
If double click will do try the below. Select the sheet tab which you want to
work with. Right click the sheet tab and click on 'View Code'. This will
launch VBE. Paste the below code to the right blank portion. Get back to to
workbook and try out.


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
If Target.Borders.Value = 1 Then
Target.Borders.LineStyle = xlLineStyleNone
Else
Target.BorderAround ColorIndex:=3, Weight:=xlThick
End If
Cancel = True
End Sub

If this post helps click Yes
 
Back
Top