Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Linking Scrollbar Min and Max values to worksheet cells
I'm not too familiar with controls, so I hope that what I'm trying to do is
easy. I've placed a scrollbar control on my worksheet. There are MIN and MAX values that can be manually entered in the properties page, but I need to reference a worksheet cell for each of these parameters. Is there an easy way to do this? Thanks, Greg |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Linking Scrollbar Min and Max values to worksheet cells
I am not a Controls expert, but try the following code:
I used cell $A$1 for the minimum value of the scrollbar, and cell $A$2 for the maximum value. I left the scrollbar named as "ScrollBar1". You might need to add some code inside of each If statement to check the values for proper range before assigning them to the ScrollBar. Private Sub Worksheet_Change(ByVal Target As Range) Dim rngScrollMin As Range 'Cell that contains Scrollbar minimum. Dim rngScrollMax As Range 'Cell that contains Scrollbar maximum. Set rngScrollMin = Range("A1") Set rngScrollMax = Range("A2") If Target.Cells.Count 1 Then Exit Sub If Not Intersect(Target, rngScrollMin) Is Nothing _ Then 'Changed cell is the cell containing the ScrollBar minimum. ScrollBar1.Min = CLng(rngScrollMin.Value) Exit Sub End If If Not Intersect(Target, rngScrollMax) Is Nothing _ Then 'Changed cell is the cell containing the ScrollBar maximum. ScrollBar1.Max = CLng(rngScrollMax.Value) Exit Sub End If End Sub -- Regards, Bill Renaud "greg235" wrote in message ... I'm not too familiar with controls, so I hope that what I'm trying to do is easy. I've placed a scrollbar control on my worksheet. There are MIN and MAX values that can be manually entered in the properties page, but I need to reference a worksheet cell for each of these parameters. Is there an easy way to do this? Thanks, Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Linking axes scale values to cells | Charts and Charting in Excel | |||
Linking worksheet tab 2, 3, 4 ... names to cells in worksheet 1 | Excel Programming | |||
ScrollBar Linking/Synching. | Excel Programming | |||
Linking cells: open source to update values | Excel Discussion (Misc queries) | |||
Linking changing values (cells) between worksheets. | Excel Worksheet Functions |