Hi John
Just some stuff out of general interest..
_ I found only one thing on the internet concerning the issues that we have come across here:
https://stackoverflow.com/questions/196 ... excel-2010" onclick="window.open(this.href);return false; ( https://stackoverflow.com/questions/196 ... ged-firing" onclick="window.open(this.href);return false; )
_ It seems to be just the event coding of type
SelectionChange which is fired off by a use of .
SpecialCells
_.______________
_ Some Tips for finding a problem such as your original problem.
_(i) Test code to set off an Event routine
If you are developing an Event routine , then it can get very tedious in testing if you have to do something like select a cell to se off an Event routine.
A simple
alternative way to make your life easier is to use a simple routine to set off your event routine. For example, using your initial code from file “el_Intersect.xlsm”
http://www.eileenslounge.com/viewtopic. ... 19#p244612" onclick="window.open(this.href);return false;
First _ 1. Select one Item from Col A's dropdown, so that some cells are hidden. For example, to hide row 12 / Item 12
Hide row 12( Item12) make row12(Item12) not visible from drop down list.JPG :
https://imgur.com/s2jilkJ" onclick="window.open(this.href);return false;
Second: _ 2 . To fire off
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Instead of …._
_......
2. Select a cell outside of the RangeName (R_MyRange) G5:Z22. Preferably between Col A to Col F
We can do
alternative:
I can write a routine like this:
Code: Select all
Sub TestMyEventCode() ' To test an event code, Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call Worksheet_SelectionChange(Target:=Range("E9")) ' This is an alternative to selecting manually cell E9
End Sub
Put that code in the same worksheet code module as
Private Sub Worksheet_SelectionChange(ByVal Target As Range) :-
Code: Select all
Sub TestMyEventCode() ' To test an event code, Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call Worksheet_SelectionChange(Target:=Range("E9")) ' This is an alternative to selecting manually cell E9
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Range("R_MyRange").SpecialCells(xlCellTypeVisible), Target) Is Nothing Then
Sheets("Sheet1").Shapes("TextBox 2").TextFrame.Characters.Text = "You selected " & Target.Address
' Button_01
Else
Sheets("Sheet1").Shapes("TextBox 2").TextFrame.Characters.Text = ""
End If
End Sub
' http://www.eileenslounge.com/viewtopic.php?f=27&t=31602&p=244545#p244612
'To reproduce the error on Sheet 1
'1. Select one Item from Col A's dropdown.
'2. Select a cell outside of the RangeName , Range(“R_MyRange”) ( Range(“G5:Z22”) ) , Preferably between Col A to Col F - like this https://imgur.com/s2jilkJ
'--- you can do like select cell E9 with this:-
' Sub TestMyEventCode() '
' Call Worksheet_SelectionChange(Target:=Range("E9")) '
' End Sub
'3. Run in [FONT=Courier New]F8[/FONT] step mode
_
3 .
Use F8 step mode to “step through” code
_ 3(i) Go into VB Editor: (
Al+ F11 from Excel ) , or for worksheet Show Code:
_1 Right mouse click in Sheet1 tab _2 Show Code .JPG :
https://imgur.com/lPeZBGn" onclick="window.open(this.href);return false;
_3(ii) Click in test code:
Select anywhere in test code.JPG :
https://imgur.com/7KYJDE6" onclick="window.open(this.href);return false; ( Put cursor inside test code,
Sub TestMyEventCode() , and left click mouse )
_3(iii) Use
F8 key --
Keyboard Key F8 .JPG :
https://imgur.com/fn91cjU" onclick="window.open(this.href);return false;
This will “step through” code –
F8, F8 , F8, ……
Step 1.JPG :
https://imgur.com/oWrsiv4" onclick="window.open(this.href);return false;
Step 2.JPG :
https://imgur.com/Ksg2P9f" onclick="window.open(this.href);return false;
Step 3.JPG :
https://imgur.com/KBhItho" onclick="window.open(this.href);return false;
Step 4.JPG :
https://imgur.com/GQmSjnR" onclick="window.open(this.href);return false;
Step 5.JPG :
https://imgur.com/tLV6eJP" onclick="window.open(this.href);return false;
Step 6.JPG :
https://imgur.com/GQmSjnR" onclick="window.open(this.href);return false;
Step 7.JPG : https://imgur.com/tLV6eJP" onclick="window.open(this.href);return false;
Step 8.JPG : https://imgur.com/GQmSjnR" onclick="window.open(this.href);return false;
Step 9.JPG : https://imgur.com/tLV6eJP" onclick="window.open(this.href);return false;
Step 10.JPG : https://imgur.com/GQmSjnR" onclick="window.open(this.href);return false;
Step 11.JPG : https://imgur.com/tLV6eJP" onclick="window.open(this.href);return false;
…..
….. :
….Step 456 , Step 457 , Step 458 ………………
…..
-…………..Step 100000000000, Step 100000000001 , …………….
………..
……… Error :
Run time error '28' : Out of stack space !!!!!!!
Or @ Step 5 ..
Stop.jpg https://imgur.com/6i0JMa0" onclick="window.open(this.href);return false; !!!!!!
_.______________________
Alan
You do not have the required permissions to view the files attached to this post.
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also