ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem displaying a UserForm (https://www.excelbanter.com/excel-programming/431011-problem-displaying-userform.html)

PATS

Problem displaying a UserForm
 
Can anyone tell me why this code is not displaying my UserForm?

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Application.Intersect(Target, Range("D7:Y7000")) Is Nothing Then
UserForm2.Show
End If


End Sub


Bob Phillips[_3_]

Problem displaying a UserForm
 
Are you changing anything in that range, as against just selecting it?

--
__________________________________
HTH

Bob

"Pats" wrote in message
...
Can anyone tell me why this code is not displaying my UserForm?

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Application.Intersect(Target, Range("D7:Y7000")) Is Nothing Then
UserForm2.Show
End If


End Sub




PATS

Problem displaying a UserForm
 
Just selecting it

"Bob Phillips" wrote:

Are you changing anything in that range, as against just selecting it?

--
__________________________________
HTH

Bob

"Pats" wrote in message
...
Can anyone tell me why this code is not displaying my UserForm?

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Application.Intersect(Target, Range("D7:Y7000")) Is Nothing Then
UserForm2.Show
End If


End Sub





Rick Rothstein

Problem displaying a UserForm
 
Another possibility... did you by any chance turn off events during your
coding session (either accidentally or on purpose)? Try executing this
statement in the Immediate window and see if that straightens things out...

Application.EnableEvents=True

--
Rick (MVP - Excel)


"Pats" wrote in message
...
Can anyone tell me why this code is not displaying my UserForm?

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Application.Intersect(Target, Range("D7:Y7000")) Is Nothing Then
UserForm2.Show
End If


End Sub



PATS

Problem displaying a UserForm
 
I also tried creating a general decleration module

Public bSELCTIONCHANGE As Boolean

and adding the line :

If bSELCTIONCHANGE Then to my code



"Pats" wrote:

Just selecting it

"Bob Phillips" wrote:

Are you changing anything in that range, as against just selecting it?

--
__________________________________
HTH

Bob

"Pats" wrote in message
...
Can anyone tell me why this code is not displaying my UserForm?

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Application.Intersect(Target, Range("D7:Y7000")) Is Nothing Then
UserForm2.Show
End If


End Sub





Bob Phillips[_3_]

Problem displaying a UserForm
 
Then try

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Application.Intersect(Target, Range("D7:Y7000")) Is Nothing Then
UserForm2.Show
End If


End Sub

--
__________________________________
HTH

Bob

"Bob Phillips" wrote in message
...
Are you changing anything in that range, as against just selecting it?

--
__________________________________
HTH

Bob

"Pats" wrote in message
...
Can anyone tell me why this code is not displaying my UserForm?

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Application.Intersect(Target, Range("D7:Y7000")) Is Nothing Then
UserForm2.Show
End If


End Sub







All times are GMT +1. The time now is 11:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com