View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Benabd Benabd is offline
external usenet poster
 
Posts: 3
Default VBA control vscroll and hscroll in a frame

Hello,

For the benefit of all, here is a description of the program that
worked for Gary.

Create a UserForm1 and add the following objects to it:

A Frame name it as Frame1 with ScrollHeight = 300 and ScrollWidth = 480
A Slider name it as SliderV with Max = 300
A Slider name it as SliderH with Max = 480
A Label name it as V
A Label name it as H

In the code area of the UserForm1 paste the following code:
Private Sub SliderH_Change()
Frame1.ScrollLeft = SliderH.Value
H.Caption = SliderH.Value
End Sub

Private Sub SliderV_Change()
Frame1.ScrollTop = SliderV.Value
V.Caption = SliderV.Value
End Sub

Now, you can control the Frame1 scrollbars using the sliders.

Regards,
Karim