Old VBA for a "check box" not working in excel 2016

richard11153

New Member
Joined
Feb 1, 2017
Messages
5
I have a workbook with VBA that was made years ago with Excel 2003. (see VBA below)
The sheets have many cells throughout that I can "Check off" with a click, to put an "X" in the cell.
(Each column has a hidden column next to it and when there is a "q" in it, the cell to the right will
put an "X" when clicked on)

I am now making an updated workbook with Excel 2016 and for some reason this VBA code
will not work. Can anyone shed some light on this, or is there a better VBA code type?
Thanks
----------------------------------------------

[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]{Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "a1:bu1450" '<=== change to suit
If ActiveCell.Offset(0, -1).Value <> "q" Then
Exit Sub
End If
On Error GoTo err_handler
Application.EnableEvents = False
If Not Application.Intersect(Target, Range(WS_RANGE)) Is Nothing Then
With Target
.Font.Name = "x"
Select Case .Value
Case "x": .Value = ""
Case Else: .Value = "x"

End Select
.Offset(0, -1).Select
End With
End If
err_handler:
Application.EnableEvents = True
End Sub}
[/FONT]
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,224,749
Messages
6,180,727
Members
452,995
Latest member
isldboy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top