Hi huuthang_bd ,
I'm sorry the code still doesn't work with me.
Say, there are 3 windows of the same workbook open.
In the "ThisWorkbook" module,
I put all your codes there.
And I put a "red stop" on the "Workbook_WindowDeactivate" line.
So I click the X-mark of the Excel app.
It takes me to the module, where the yellow bar stop on my "red stop".
I push f8 to step-by-step running the code :
Soon after the yellow reach "End If" it goes to the "End Sub" then close whatever window which is active.
Again I click the X-mark of the Excell app, push f8 to step-by-step running the code, after the end sub, it close the active window.
It never reach to go to the below codes :
The same thing if I don't put the "red stopper" at all on the codes,
I still have to click the X mark n times depending on how many n of the windows open.
Actually I'm in the option whether to do :
A. open two windows of the same workbook, but showing different sheet
or
B. show a Userform (listview, as in my other thread).
But anyway, thank you once again huuthang_bd.
Bookmarks