Excel: Scroll Evnt

G

g.haarish

Hi All,

Will the scroll (Horiz, Vert) bars generate an event that can be
handled with a user defined macro? I have problems with freeze panes
on using the horiz scroll bar. A dropdown list on the freeze pane is
displaced from its original location on paging to the right using the
scroll bar and eventually loses its funtionality. Any ideas?

Many Thanks,
Haarish.
 
C

Chip Pearson

Haarish,

There is no event that is triggered when you scroll in a window. You can use
a technique called "subclassing" to detect the Windows messages sent during
scrolling. VBA doesn't have the performance horsepower to do the actual
subclassing itself, so I use a free DLL from vbAccellerator,
www.vbaccellerator.com, called SSubTimer6.dll. Once you have that DLL on
your machine, you can use the class module on my web site to detect
scrolling. The class will raise normal VBA events for scrolling up/down
left/right by page/line.

See http://www.cpearson.cm/Excel/DetectScroll.htm details and downloadable
example workbook.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top