Thread: Scroll Event
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
sonu[_2_] sonu[_2_] is offline
external usenet poster
 
Posts: 31
Default Scroll Event

Susan,

I may not be saying it right.

Just like on change or calculate events we can run a sub to do
something I want to find out when user scroll so that I can do
something or run some sub.

What I am trying to do is to have button in my excel to run some
macros. I want this button to be on the worksheet and always on top
line that is visible in the window. if user scroll either by using
scroll bar or mouse I want that button to flote with spreadsheet. Just
like some time you see some buttons or add with some web sites.

To do this I need to trap scroll event. I dont see that in excel. I was
woundering if I can create it using class module.

Susan wrote:
and why do you say there is no scroll event? when you record a macro &
scroll, you get:

Range("B3").Select
ActiveWindow.LargeScroll Down:=1
ActiveWindow.SmallScroll Down:=5
Range("B30").Select

doesn't that constitute an event? if not, can you explain why not?
thanks
susan


sonu wrote:
Chip,

But I thought we could create events that are not part of xls events by
using class module.

Is this not right?


Chip Pearson wrote:
I don't think you can do this, class module or not. There is no "scroll"
event for any object in Excel, so you would have no way of detecting when
the sheet or window is scrolled.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)

"sonu" wrote in message
ups.com...
How can I develop an event using class module that can detect if
current windows has been scrolled. either by using scroll bar or mouse
wheel.

I know little bit about class modules and develop a test event using
raise event and with event commands.

I read and used the article on the following link but still now sure
how to do this with scroll bar.

http://www.tushar-mehta.com/excel/vb...xl%20event.htm