by the way, even though I cross-posted to the other forum, I still haven't gotten my issue resolved. so, if anyone would be willing to help me with this, I'd greatly appreciate it!
updated code (in module 1):
Sub PhasorControl()
Dim Bar As ScrollBar
Dim Fract, Freq, minval, incrsmall, incrlarge
'determine which value should be minimum
If Sheet2.Range("A2").Value = 0.0625 Then
minval = Sheet2.Range("A6").Value
Else
minval = Sheet2.Range("A3").Value
End If
Fract = Sheet1.Range("B6").Value
Freq = Sheet1.Range("D6").Value
incrsmall = 1 / Fract
incrlarge = 4 / Fract
Set Bar = Sheet3.ScrollBars("Scroll Bar 1")
With Worksheets("Sheet3").Shapes("Scroll Bar 1")
With .ControlFormat
.Max = Freq
.Min = minval
.SmallChange = incrsmall
.LargeChange = incrlarge)
End With
End With
End Sub
when i check my properties after the code is assigned to the scrollbar, my min value and both increment values go to zero, but my max value is correct. Any ideas? Since i've had such difficulty, I tried an ActiveX scrollbar, but ran into the exact same problems. Here is my code for it in the Sheet3 module:
Private Sub ScrollBar1_Change()
Dim Bar As OLEObject
Dim Fract, Freq, minval, incrsmall, incrlarge
'determine which value should be minimum
If Sheet2.Range("A2").Value = 0.0625 Then
minval = Sheet2.Range("A6").Value
Else
minval = Sheet2.Range("A3").Value
End If
Fract = Sheet1.Range("B6").Value
Freq = Sheet1.Range("D6").Value
incrsmall = 1 / Fract
incrlarge = 4 / Fract
Set Bar = Sheet3.OLEObjects("ScrollBar1")
With Bar
.Object.Max = Freq
.Object.Min = minval
.Object.SmallChange = incrsmall
.Object.LargeChange = incrlarge
End With
End Sub
Thanks in advance for any help!
Bookmarks