Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Disable Doubleclick

I am trying to disable the mouse doubleclick on certain
cells(range) of a spreadsheet. I know how to disable
doubleclicking for the entire spreadsheet using:

Application.EditDirectlyInCell = False

Is there a way apply this to a specific range only?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Disable Doubleclick

In the BeforeDoubleClick event of the Worksheet:

If Not Intersect(Target, Range("A1:D4")) Is Nothing Then Cancel = True

--

Vasant



"Brandon" wrote in message
...
I am trying to disable the mouse doubleclick on certain
cells(range) of a spreadsheet. I know how to disable
doubleclicking for the entire spreadsheet using:

Application.EditDirectlyInCell = False

Is there a way apply this to a specific range only?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Disable Doubleclick

Brandon,

In the Workbook code:

Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target
As Range, Cancel As Boolean)
If Not Intersect(Target, Range("A1")) Is Nothing Then Cancel = True
End Sub

This is for doubleclick only, it doesn't prevent a user from editting
directly in the formula bar.

Rob


"Brandon" wrote in message
...
I am trying to disable the mouse doubleclick on certain
cells(range) of a spreadsheet. I know how to disable
doubleclicking for the entire spreadsheet using:

Application.EditDirectlyInCell = False

Is there a way apply this to a specific range only?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Disable Doubleclick

Brandon,

Try this....Doubleclick disabled for range A1:B3 only
(modify to suit)

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Not Intersect(Target, Range("A1:B3")) Is Nothing Then
Application.EditDirectlyInCell = False
Cancel = True
Application.EditDirectlyInCell = True
End If
End Sub

John


"Brandon" wrote in message
...
I am trying to disable the mouse doubleclick on certain
cells(range) of a spreadsheet. I know how to disable
doubleclicking for the entire spreadsheet using:

Application.EditDirectlyInCell = False

Is there a way apply this to a specific range only?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Disable Doubleclick

Brandon,

Vasant's and Rob's answers are a lot less overkill.
Use what they gave you instead of what I gave you.

John

"John Wilson" wrote in message
...
Brandon,

Try this....Doubleclick disabled for range A1:B3 only
(modify to suit)

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Not Intersect(Target, Range("A1:B3")) Is Nothing Then
Application.EditDirectlyInCell = False
Cancel = True
Application.EditDirectlyInCell = True
End If
End Sub

John


"Brandon" wrote in message
...
I am trying to disable the mouse doubleclick on certain
cells(range) of a spreadsheet. I know how to disable
doubleclicking for the entire spreadsheet using:

Application.EditDirectlyInCell = False

Is there a way apply this to a specific range only?







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Disable Doubleclick

or more simply

Cancel = Not (Intersect(Target, Range("A1:D4")) Is Nothing )
--
Patrick Molloy
Microsoft Excel MVP
----------------------------------
"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
In the BeforeDoubleClick event of the Worksheet:

If Not Intersect(Target, Range("A1:D4")) Is Nothing Then Cancel = True

--

Vasant



"Brandon" wrote in message
...
I am trying to disable the mouse doubleclick on certain
cells(range) of a spreadsheet. I know how to disable
doubleclicking for the entire spreadsheet using:

Application.EditDirectlyInCell = False

Is there a way apply this to a specific range only?





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Disable Doubleclick

Nice, Patrick!

Regards,

Vasant.

"Patrick Molloy" wrote in message
...
or more simply

Cancel = Not (Intersect(Target, Range("A1:D4")) Is Nothing )
--
Patrick Molloy
Microsoft Excel MVP
----------------------------------
"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
In the BeforeDoubleClick event of the Worksheet:

If Not Intersect(Target, Range("A1:D4")) Is Nothing Then Cancel = True

--

Vasant



"Brandon" wrote in message
...
I am trying to disable the mouse doubleclick on certain
cells(range) of a spreadsheet. I know how to disable
doubleclicking for the entire spreadsheet using:

Application.EditDirectlyInCell = False

Is there a way apply this to a specific range only?







  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Disable Doubleclick

Thank you all for your answers. I tried them all and they
worked.
I used the following code from Patrick Molloy and it
disabled the doubleclick for the range of cells from A1
to A10.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As
Range, Cancel As Boolean)
Cancel = Not (Intersect(Target, Range("A1:A10")) Is
Nothing)
End Sub

Thanks a lot to all of you,
Brandon

-----Original Message-----
I am trying to disable the mouse doubleclick on certain
cells(range) of a spreadsheet. I know how to disable
doubleclicking for the entire spreadsheet using:

Application.EditDirectlyInCell = False

Is there a way apply this to a specific range only?
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
XLT files not opening on doubleclick Daniel Excel Discussion (Misc queries) 2 August 22nd 07 03:16 PM
ON.DOUBLECLICK function C Brandt Excel Discussion (Misc queries) 8 May 20th 07 12:27 AM
Force VB to doubleclick in a cell Brettjg Excel Discussion (Misc queries) 4 March 2nd 07 03:21 PM
doubleclick PH NEWS Excel Worksheet Functions 1 March 10th 06 11:54 AM
Before DoubleClick John Pierce Excel Programming 1 October 28th 03 01:47 PM


All times are GMT +1. The time now is 01:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"