PC Review


Reply
Thread Tools Rate Thread

before double click

 
 
T. Valko
Guest
Posts: n/a
 
      10th Apr 2007
Hi Folks!

Just "tinkering" around. How do you keep from going into edit mode on a
before double click event?

Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

Dim myHeight As Double
Application.EnableEvents = False
On Error GoTo sub_exit
If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
With Target
If .Value = "a" Then
.Value = ""
Else
myHeight = .EntireRow.RowHeight
.Value = "a"
.Font.Name = "Marlett"
.EntireRow.RowHeight = myHeight
End If
End With
End If
sub_exit:
Application.EnableEvents = True
End Sub

Biff


 
Reply With Quote
 
 
 
 
JE McGimpsey
Guest
Posts: n/a
 
      10th Apr 2007
Set Cancel to True if your condition is followed:

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Range, Cancel As Boolean)

Dim myHeight As Double
Application.EnableEvents = False
On Error GoTo sub_exit
If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
With Target
If .Value = "a" Then
.Value = ""
Else
myHeight = .EntireRow.RowHeight
.Value = "a"
.Font.Name = "Marlett"
.EntireRow.RowHeight = myHeight
End If
End With
Cancel = True
End If
sub_exit:
Application.EnableEvents = True
End Sub


In article <(E-Mail Removed)>,
"T. Valko" <(E-Mail Removed)> wrote:

> Hi Folks!
>
> Just "tinkering" around. How do you keep from going into edit mode on a
> before double click event?
>
> Option Explicit
>
> Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
> Boolean)
>
> Dim myHeight As Double
> Application.EnableEvents = False
> On Error GoTo sub_exit
> If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
> With Target
> If .Value = "a" Then
> .Value = ""
> Else
> myHeight = .EntireRow.RowHeight
> .Value = "a"
> .Font.Name = "Marlett"
> .EntireRow.RowHeight = myHeight
> End If
> End With
> End If
> sub_exit:
> Application.EnableEvents = True
> End Sub
>
> Biff

 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      10th Apr 2007
Thanks, JE!

Biff

"JE McGimpsey" <(E-Mail Removed)> wrote in message
news:jemcgimpsey-(E-Mail Removed)...
> Set Cancel to True if your condition is followed:
>
> Private Sub Worksheet_BeforeDoubleClick( _
> ByVal Target As Range, Cancel As Boolean)
>
> Dim myHeight As Double
> Application.EnableEvents = False
> On Error GoTo sub_exit
> If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
> With Target
> If .Value = "a" Then
> .Value = ""
> Else
> myHeight = .EntireRow.RowHeight
> .Value = "a"
> .Font.Name = "Marlett"
> .EntireRow.RowHeight = myHeight
> End If
> End With
> Cancel = True
> End If
> sub_exit:
> Application.EnableEvents = True
> End Sub
>
>
> In article <(E-Mail Removed)>,
> "T. Valko" <(E-Mail Removed)> wrote:
>
>> Hi Folks!
>>
>> Just "tinkering" around. How do you keep from going into edit mode on a
>> before double click event?
>>
>> Option Explicit
>>
>> Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
>> Boolean)
>>
>> Dim myHeight As Double
>> Application.EnableEvents = False
>> On Error GoTo sub_exit
>> If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
>> With Target
>> If .Value = "a" Then
>> .Value = ""
>> Else
>> myHeight = .EntireRow.RowHeight
>> .Value = "a"
>> .Font.Name = "Marlett"
>> .EntireRow.RowHeight = myHeight
>> End If
>> End With
>> End If
>> sub_exit:
>> Application.EnableEvents = True
>> End Sub
>>
>> Biff



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
File explorer hangs when right-click, ctrl-c, shift-delete, double-click =?Utf-8?B?RG91Zw==?= Windows XP Networking 1 9th Oct 2010 07:46 AM
Double click right mouse not a double click Freddy Windows XP Internet Explorer 5 23rd Jan 2008 10:12 AM
Double click event invoked when no double click has occurred Michael Matuszak Microsoft Access Forms 0 6th Aug 2004 03:51 PM
File explorer hangs for many seconds when right-click, or ctrl-c, or double-click =?Utf-8?B?RG91Zw==?= Windows XP Help 2 15th Feb 2004 05:11 PM
No Double-Click event fired for a ListView when I double click. active Microsoft VB .NET 1 26th Nov 2003 05:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:58 AM.