hobbiton73
10-31-2012, 09:47 AM
Hi, I wonder whether someone may be able to help me please.
Firstly my apologies because to some this may be a very stupid error, but I'm only really just starting to learn and understand VBA.
I'm using the code below to attempt to prevent users from double clicking in a cell within a given range.
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("B5:Q2000")) Is Nothing Then Cancel = True
End Sub
Unfortunately it's not working because the 'Double Click' is still enabled and I'm not sure where I'm going wrong.
I just wondered whether someone may be able to take a look at this please and provide some guidance on where my error is?
Many thanks and kind regards
Firstly my apologies because to some this may be a very stupid error, but I'm only really just starting to learn and understand VBA.
I'm using the code below to attempt to prevent users from double clicking in a cell within a given range.
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("B5:Q2000")) Is Nothing Then Cancel = True
End Sub
Unfortunately it's not working because the 'Double Click' is still enabled and I'm not sure where I'm going wrong.
I just wondered whether someone may be able to take a look at this please and provide some guidance on where my error is?
Many thanks and kind regards