Worksheet VBA macro with splitt panes very slow

spreader

New Member
Joined
May 13, 2009
Messages
6
Hello all,

I am at a loss and need your crowd inteligence.

For my music repertoire I created a workbook with a songlist, that I have automated with some useful macros. Basically I can filter the songlist, open youtube videos to the song on youtube and also have put the chord sheets in the workbook, that I also can access from the central "songlist" worksheet. For convinience of stepping through the titles and show the chord charts at the same time I made use of the create new window (pane) and grouped those 2 windows vertically. That was a little bit fuzzy and trial and error until I had it function the way I wanted. The code is not so pretty - but it worked as intended.

The full file is at the moment around 600K bit and contains approximately 50 sheets with only text data. I would think that is nothing excel would get sweaty about.

As to step through the titles from the songslist I entered the code in the Worksheet_SelectionChange event so I can easily step down with the arrow keys to get the next chordsheet. This should placed right next to the songlist. Assuming there is already a second window of the same workbook open, I have this close function in the code - if nothing was open yet, the on error resume next catches that case.

For some reason the code runs in the normal usage of the automated songlist sheet incredibly slow (nearly 10 seconds on a modern laptop with I7 intel core).
When I debug the code it runs quick - now brakes, not waiting - every command seems to be executed instantly. The big question is, why the worksheet does not match the performance in exceution during Worksheet_SelectionChange event. The code I have under suspicion is yellow marked. During the worksheet event I realize, that the closing of the second pane with the chordsheets takes long. In debugging it works like a breeze (quick).

Please find the code snippet of the Worksheet_SelectionChange event procedure and the MSO version I am using.

Hope one of you can come up with an idea - I am at a loss now!

Cheers
Stefan
 

Attachments

  • Code_Snippet.png
    Code_Snippet.png
    23.5 KB · Views: 21
  • MSO_Version_Info.png
    MSO_Version_Info.png
    5.1 KB · Views: 21
When posting vba code in the forum, please use the available code tags. It makes your code much easier to read/debug & copy. My signature block below has more details. I have added the tags for you this time. 😊
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,215,077
Messages
6,122,991
Members
449,094
Latest member
masterms

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top