ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA for put cell C2 in overstrike/black when B2 checkbox is ticked? (https://www.excelbanter.com/excel-programming/323056-vba-put-cell-c2-overstrike-black-when-b2-checkbox-ticked.html)

StargateFan[_3_]

VBA for put cell C2 in overstrike/black when B2 checkbox is ticked?
 
I was thinking that it would help with a list I have if I added a
column with a checkbox that, once ticked, would put contents in cell
to the right of it in list, in overstrike and black (as the font is
coloured to begin with). How would one go about that? Tx!


Tom Ogilvy

VBA for put cell C2 in overstrike/black when B2 checkbox is ticked?
 
Private Sub Checkbox1_Click()
Dim rng as Range
set rng = me.OleObjects("CheckBox1").TopLeftCell
if checkbox1.Value then
With rng.offset(0,1).Font
.StrikeThrough = True
.ColorIndex = xlAutomatic
End With
else
With rng.offset(0,1).Font
.StrikeThrough = False
.ColorIndex = 3
End With
End if
End Sub

--
Regards,
Tom Ogilvy

"StargateFan" wrote in message
...
I was thinking that it would help with a list I have if I added a
column with a checkbox that, once ticked, would put contents in cell
to the right of it in list, in overstrike and black (as the font is
coloured to begin with). How would one go about that? Tx!





All times are GMT +1. The time now is 10:41 AM.

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