PDA

View Full Version : [SOLVED] Is there a Scroll Event?



JKwan
05-26-2005, 10:23 AM
Does Scroll Event exists with the Sheet object (I think that's the jargon), this is not the same as the ActiveX object - the actual scroll bar with the Sheet.
So, if I start scrolling at the bottom, I want to trap that event an process it.

Norie
05-26-2005, 10:40 AM
I'm afraid there is no scroll event.

What so you actually want to do? Perhaps there's another approach.

JKwan
05-26-2005, 12:51 PM
That's what I thought.

I got a routine to dynamically reposition the buttons on my spreadsheet (basically - the buttons are always a visible), however, I need to run the routine everytime when I scroll off the visible page. So, if there is an event on the scroll bar, that is the best way to execute the repositioning routine.

CBrine
05-26-2005, 01:33 PM
JKwan,
Why don't you just add the buttons to a custom toolbar? Instead of worrying about where they appear on the worksheet?

HTH
Cal

johnske
05-26-2005, 01:35 PM
That's what I thought.

I got a routine to dynamically reposition the buttons on my spreadsheet (basically - the buttons are always a visible), however, I need to run the routine everytime when I scroll off the visible page. So, if there is an event on the scroll bar, that is the best way to execute the repositioning routine.

Hi,

It looks like you need to use a "Goto" routine, have a look here http://www.vbaexpress.com/kb/getarticle.php?kb_id=485

Regards,
John

JKwan
05-26-2005, 02:34 PM
CBrine:
Yes, I can do the toolbar, it is just not as fun programming the dynamic repositioning.

Johnske:
Thanks for the pointer to the KB, the only thing is that I cannot see how it can help me. It executes it once. I want it to be dynamic.

I hooked my routine to the Resize Event, it is dynamically repositioning my controls - this works nicely. Would be nice if this can be hooked to a "scroll" event.

I guess I can do the SheetActivate Event and just reposition the controls once.

Thanks for the suggestions.

MWE
05-26-2005, 08:02 PM
perhaps I do not fully understand what you want to do, but you can scroll the active window, e.g.,

ActiveWindow.SmallScroll Down:=28
ActiveWindow.SmallScroll ToRight:=0
ActiveWindow.ScrollRow = 1