Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Do not execute Double Click Event when UserForm is Showing

Is there a way to not execute the Event below if any UserForm is showing?

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

If a UserForm is showing Exit Sub Else Continue with code..

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Do not execute Double Click Event when UserForm is Showing

Hi,

You could in VB editor right click the userform and click properties and set
the 'ShowModal' property to TRUE

Mike

"RyanH" wrote:

Is there a way to not execute the Event below if any UserForm is showing?

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

If a UserForm is showing Exit Sub Else Continue with code..

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Do not execute Double Click Event when UserForm is Showing

I knew about that, but if the user wants to minimize Excel they would need to
finish the UserForm, Close it, then minimize Excel. In some cases the user
needs to keep the UserForm open and minimize Excel to access other programs.
In the mean time I do not want my Double Click Event to execute if a UserForm
is open, because it will screw up some formatting I have. Is there another
way?

"Mike H" wrote:

Hi,

You could in VB editor right click the userform and click properties and set
the 'ShowModal' property to TRUE

Mike

"RyanH" wrote:

Is there a way to not execute the Event below if any UserForm is showing?

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

If a UserForm is showing Exit Sub Else Continue with code..

End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Do not execute Double Click Event when UserForm is Showing

Assuming you are showing your UserForm as vbModeless and assuming your
UserForm is named UserForm1 (change the code for your actual UserForm name),
put this as the first statement in the BeforeDoubleClick event...

If UserForm1.Visible Then Exit Sub

Rick


"Mike H" wrote in message
...
Hi,

You could in VB editor right click the userform and click properties and
set
the 'ShowModal' property to TRUE

Mike

"RyanH" wrote:

Is there a way to not execute the Event below if any UserForm is showing?

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

If a UserForm is showing Exit Sub Else Continue with code..

End Sub


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Do not execute Double Click Event when UserForm is Showing

If UserForms.Count Then exit sub

If you want to test if a particular userform is both loaded and visible

If UserForms.Count Then
For i = 0 To UserForms.Count - 1
If UserForms(i).Name = "UserForm2" Then
bUF2loaded = True
bUF2Visible = UserForms(i).Visible
Exit For
End If
Next
End If

Regards,
Peter T

"RyanH" wrote in message
...
Is there a way to not execute the Event below if any UserForm is showing?

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

If a UserForm is showing Exit Sub Else Continue with code..

End Sub





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
Is there a double click event for cell? Ayo Excel Discussion (Misc queries) 3 June 6th 08 12:18 AM
Double click cell to execute macro JDaywalt Excel Programming 12 August 15th 07 02:47 PM
userform label double-click goes to click event John Paul Fullerton Excel Programming 3 May 19th 06 05:54 PM
Click on graph bar to execute a double-click in a pivot table cell [email protected] Charts and Charting in Excel 4 August 3rd 05 01:37 AM
Before Double Click Event gregork Excel Programming 4 February 9th 04 09:17 AM


All times are GMT +1. The time now is 10:33 PM.

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

About Us

"It's about Microsoft Excel"