Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2012 How to properly use the ActiveX Scroll Bar Control

$
0
0
So I am having issues trying to use an ActiveX Scroll Bar. I have a macro opened with the control bar that reads something like:

Private Sub ScrollBar1_Change()
Worksheets("Gas Turbine").Cells(8, 3).Value = Worksheets("720").Cells(Record.Value, 51).Value
Worksheets("Gas Turbine").Cells(10, 3).Value = Worksheets("720").Cells(Record.Value, 35).Value
Worksheets("Gas Turbine").Cells(11, 3).Value = Worksheets("720").Cells(Record.Value, 38).Value
Worksheets("Gas Turbine").Cells(13, 3).Value = Worksheets("720").Cells(Record.Value, 32).Value
etc...
End Sub

What I want is for my data to change when I click on the scroll bar. But whenever I attempt to click on it, I receive a message that says "Run-time error '424': Object required...
It doesn't like the fact that I am using Record.Value.
I tried changing Record.Value to simply Record (a constant),
and I manually set Record to be any value between 7 and 800 (the length of the data that I have).
It works this way, but only for the given value (say I have Record=7, then the data changes corresponding to "7". I have to manually change the "Record" value in Excel for it to show the new data)
Hope this makes sense.
In short, I am having issues understanding how to code with an ActiveX Scroll Bar.

Any pointers, suggestions, help?

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>