Scrollbar macros

E

Erich Neuwirth

I want to use scrollbars to change the speed of some MIDI things that
are being played using the new midiprocessing ocx controls
available from Sourceforge.

I need a macro which fires when a scrollbar handle is moved, not only
when it is release, since I want to change speed continually.

I have been totally unsuccessful with the scrollbar from the
Control toolbox, the Scrollbar_Change macro is not even executed while
another macro is running.

The macro associated with a scrollbar from the Forms toolbox works,
but only when I release the scrollbar handle, not while I am moving it.
It behaves like it were a modal object, and I would like the
scrollbar to be modeless. Can it be done?
 
H

Harald Staff

Hi

With a scrollbar from the controls toolbox onto a worksheet, these two works
fine here. "Scroll" is the event that fires on scrolling. THis code goes in
the worksheet module (rightclick the scrollbar, go "view code" to get to the
right place).

Private Sub ScrollBar1_Change()
Cells(1, 1).Value = ScrollBar1.Value
Cells(1, 2).Value = "change"
End Sub

Private Sub ScrollBar1_Scroll()
Cells(1, 1).Value = ScrollBar1.Value
Cells(1, 2).Value = "scroll"
End Sub

So question is what your "another macro" does and if you can reorganize the
code if it conflicts.

HTH. Best wishes Harald
 
E

Erich Neuwirth

The Scroll event solved my problem.
Thank you.


Harald said:
Hi

With a scrollbar from the controls toolbox onto a worksheet, these two works
fine here. "Scroll" is the event that fires on scrolling. THis code goes in
the worksheet module (rightclick the scrollbar, go "view code" to get to the
right place).

Private Sub ScrollBar1_Change()
Cells(1, 1).Value = ScrollBar1.Value
Cells(1, 2).Value = "change"
End Sub

Private Sub ScrollBar1_Scroll()
Cells(1, 1).Value = ScrollBar1.Value
Cells(1, 2).Value = "scroll"
End Sub

So question is what your "another macro" does and if you can reorganize the
code if it conflicts.

HTH. Best wishes Harald
 

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