Hi guys,
I've watched a tutorial on how to hide and unhide columns on a particular sheet with the use of FormControl checkboxes (I want to use the checkboxes to add/remove series from a column graph by hiding/unhiding columns), the following code was used and it worked in the tutorial but when I try and run it in my Excel 2013 workbook it highlights the bolded line with a run-time error '424' (Object Required), how do I fix it?
Code
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
Columns("G:G").Select
Selection.EntireColumn.Hidden = True
End If
If CheckBox1.Value = False Then
Columns("G:G").Select
Selection.EntireColumn.Hidden = False
End If
End Sub
If CheckBox1.Value = True Then
Many thanks,
Stas