Scrollbar not talking to me.

G

Greg Glynn

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
 
N

Nigel

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
 

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