ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Scrollbar not talking to me. (https://www.excelbanter.com/excel-programming/362677-scrollbar-not-talking-me.html)

Greg Glynn[_4_]

Scrollbar not talking to me.
 
I have a worksheet with 5 scrollbars on it. The following code doesn't
work. It gives me:
runtime error 424: Object required (When trying to reset the value of
scrollbar 1).


Windows("Surveys.xls").Activate
Range("Comments").Value = ""

'This next bit should work - But didn't.
ScrollBar1.Value = 0
ScrollBar2.Value = 0
ScrollBar3.Value = 0
ScrollBar4.Value = 0
ScrollBar5.Value = 0

Anyone know why?

Thanks in advance

Greg


Nigel

Scrollbar not talking to me.
 
If your code you are running is not in the worksheet where the controls
reside, then declare their reference prefixed with the sheet as follows

Sheets("Sheet1").ScrollBar1.Value = 0

* changed sheet name as required

--
Cheers
Nigel



"Greg Glynn" wrote in message
oups.com...
I have a worksheet with 5 scrollbars on it. The following code doesn't
work. It gives me:
runtime error 424: Object required (When trying to reset the value of
scrollbar 1).


Windows("Surveys.xls").Activate
Range("Comments").Value = ""

'This next bit should work - But didn't.
ScrollBar1.Value = 0
ScrollBar2.Value = 0
ScrollBar3.Value = 0
ScrollBar4.Value = 0
ScrollBar5.Value = 0

Anyone know why?

Thanks in advance

Greg




Greg Glynn[_4_]

Scrollbar not talking to me.
 
Perfect. Thanks (I knew it was something "simple").

Regards

Greg



All times are GMT +1. The time now is 03:40 AM.

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