ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ScrollBar is still activated when pressed 2 times in a row (https://www.excelbanter.com/excel-programming/315353-re-scrollbar-still-activated-when-pressed-2-times-row.html)

Vic Eldridge

ScrollBar is still activated when pressed 2 times in a row
 
Your code appears to work fine if you put it in the Scrollbar's
GotFocus event.

Private Sub ScrollBar1_GotFocus()
With ScrollBar1
.Min = 1
.Max = 30
.LargeChange = 5
.SmallChange = 1
End With
Range("A1").Select
Range("A1") = ScrollBar1.Value
End Sub


Regards,
Vic Eldridge


0000_AAAA_0000 wrote in message ...
I have a Scroll Bar:

Private Sub ScrollBar1_Change()
With ScrollBar1
.Min = 1
.Max = 30
.LargeChange = 5
.SmallChange = 1
End With
Range("A1").Select
End Sub


My problem comes because only once every to times I am eble to
accompliss this:
Range("A1").Select
Usually if I press the ScrollBar when Range("A1") is activated none
cell becomes activated the next time, the ScrollBar is activated.
and
if Range("A1") in this case is not selected the ScrollBar becomes
activated.

How can Avoid this and select Range("A1") every time????


Many thanks in advance!!



All times are GMT +1. The time now is 09:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com