cookeetree
Board Regular
- Joined
- Mar 2, 2015
- Messages
- 53
G'day Excel Gods,
I'm trying to run what should be simple code to clear the contents of a range when a checkbox is ticked.
The checkbox is linked to cell D33.
Sub OneforOne_CheckBox()
If Range("D33") = True Then
Range.("L34:U41").ClearContents
End If
End Sub
The code keeps failing on the middle line.
I've tried changing the range to include the worksheet name - Worksheets("Compaction1").Range.("L34:U41").ClearContents - but it still fails.
Where am I going wrong??? It's driving me nuts!
Any assistance you could provide would be greatly appreciated.
Cheer, Jason.
I'm trying to run what should be simple code to clear the contents of a range when a checkbox is ticked.
The checkbox is linked to cell D33.
Sub OneforOne_CheckBox()
If Range("D33") = True Then
Range.("L34:U41").ClearContents
End If
End Sub
The code keeps failing on the middle line.
I've tried changing the range to include the worksheet name - Worksheets("Compaction1").Range.("L34:U41").ClearContents - but it still fails.
Where am I going wrong??? It's driving me nuts!
Any assistance you could provide would be greatly appreciated.
Cheer, Jason.