ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Object Required (https://www.excelbanter.com/excel-programming/430318-object-required.html)

Philosophaie

Object Required
 

I used the following program in the Macro of a ScrollBar1:

Private Sub ScrollBar1_GotFocus()
ScrollBar1.Min = WorksheetFunction.Min(Range("A2:A25"))
ScrollBar1.Max = WorksheetFunction.Max(Range("A2:A25"))
End Sub
Private Sub ScrollBar1_Scroll()
ScrollBar1_Change
End Sub
Private Sub ScrollBar1_Change()
Sheets("Sheet1").Cells(3, 4) = ScrollBar1.Value
End Sub

I get this error:

Run-Time Error '424':
Object Required

The Debugger points to the ScrollBar1.value in the ScrollBar1_Change
subroutine.

Jim Thomlinson

Object Required
 

There must be more to it. That exact code works for me...
--
HTH...

Jim Thomlinson


"Philosophaie" wrote:

I used the following program in the Macro of a ScrollBar1:

Private Sub ScrollBar1_GotFocus()
ScrollBar1.Min = WorksheetFunction.Min(Range("A2:A25"))
ScrollBar1.Max = WorksheetFunction.Max(Range("A2:A25"))
End Sub
Private Sub ScrollBar1_Scroll()
ScrollBar1_Change
End Sub
Private Sub ScrollBar1_Change()
Sheets("Sheet1").Cells(3, 4) = ScrollBar1.Value
End Sub

I get this error:

Run-Time Error '424':
Object Required

The Debugger points to the ScrollBar1.value in the ScrollBar1_Change
subroutine.


Norie

Object Required
 
Where exactly is this code and the control located?
On Jun 24, 8:01*pm, Philosophaie
wrote:
I used the following program in the Macro of a ScrollBar1:

Private Sub ScrollBar1_GotFocus()
* * ScrollBar1.Min = WorksheetFunction.Min(Range("A2:A25"))
* * ScrollBar1.Max = WorksheetFunction.Max(Range("A2:A25"))
End Sub
Private Sub ScrollBar1_Scroll()
* * ScrollBar1_Change
End Sub
Private Sub ScrollBar1_Change()
* * Sheets("Sheet1").Cells(3, 4) = ScrollBar1.Value
End Sub

I get this error:

Run-Time Error '424':
Object Required

The Debugger points to the ScrollBar1.value in the ScrollBar1_Change
subroutine.




All times are GMT +1. The time now is 01:16 AM.

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