Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default ScrollBar - set MIN/MAX cell value

Hello,
I have a template sheet that uses cell "M1" value as the row match within
index functions throughout the sheet.

I'd like to use a scrollbar to allow users to change the "M1" value using
the scroll bar in turn changing results of the index function while staying
within perimeters of cell "M2" (The Minimum) AND cell "M3" (The Maximum).

These variables (MIN & MAX levels) will change each time template document
is entered by user, requiring the MIN & MAX settings of scrollbar to reset to
the "M2" and "M3" values

I believe this can be accomplished from the limited amount of info browsed
through on web using event macro but I've had no success sorting through
myself.


Any Help would be greatly appreciated. Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default ScrollBar - set MIN/MAX cell value

paste this into the sheet's cod page (right click sheet tab, click View
Code)
In my case, the scroll bar has the default name. you may want to change this

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$M$2", "$M$3"
setMinMax
End Select
Target.Select
End Sub

Sub setMinMax()
Dim ctrl As ScrollBar
Shapes("Scroll Bar 1").Select
With Selection
.Min = Range("M2")
.Max = Range("M3")
End With
End Sub





"SteveT" wrote in message
...
Hello,
I have a template sheet that uses cell "M1" value as the row match within
index functions throughout the sheet.

I'd like to use a scrollbar to allow users to change the "M1" value using
the scroll bar in turn changing results of the index function while
staying
within perimeters of cell "M2" (The Minimum) AND cell "M3" (The Maximum).

These variables (MIN & MAX levels) will change each time template document
is entered by user, requiring the MIN & MAX settings of scrollbar to reset
to
the "M2" and "M3" values

I believe this can be accomplished from the limited amount of info browsed
through on web using event macro but I've had no success sorting through
myself.


Any Help would be greatly appreciated. Thanks,


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default ScrollBar - set MIN/MAX cell value

Thanks Patrick for your response but I'm getting
Run-time '438' error
'Object doesn't support this property or method'

I managed by tinkering to get following to work, but it fails to work
automatically when i exit the sheet after the last settings = Min 1 / Max 1.
In other words as long as my Max stays above 1, i can rely on below to change
automatically upon entry into sheet.

Private Sub ScrollBar1_Change()
With ScrollBar1
.Min = Range("M2").Value
.Max = Range("M3").Value
End With
End Sub

I can reset to begin working again if i manually run the event in Visual
Basic but I'd like it if my entry macro (mac that takes user to this screen)
auto triggers the scrollbar reset.

Thanks again / Brgds

"Patrick Molloy" wrote:

paste this into the sheet's cod page (right click sheet tab, click View
Code)
In my case, the scroll bar has the default name. you may want to change this

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$M$2", "$M$3"
setMinMax
End Select
Target.Select
End Sub

Sub setMinMax()
Dim ctrl As ScrollBar
Shapes("Scroll Bar 1").Select
With Selection
.Min = Range("M2")
.Max = Range("M3")
End With
End Sub





"SteveT" wrote in message
...
Hello,
I have a template sheet that uses cell "M1" value as the row match within
index functions throughout the sheet.

I'd like to use a scrollbar to allow users to change the "M1" value using
the scroll bar in turn changing results of the index function while
staying
within perimeters of cell "M2" (The Minimum) AND cell "M3" (The Maximum).

These variables (MIN & MAX levels) will change each time template document
is entered by user, requiring the MIN & MAX settings of scrollbar to reset
to
the "M2" and "M3" values

I believe this can be accomplished from the limited amount of info browsed
through on web using event macro but I've had no success sorting through
myself.


Any Help would be greatly appreciated. Thanks,


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Scrollbar Help kay Charts and Charting in Excel 1 October 29th 08 05:35 PM
insert scrollbar into a cell in Excel Nick Excel Worksheet Functions 0 October 19th 05 05:56 PM
scrollbar reslut makes another scrollbar to show Patrik Excel Discussion (Misc queries) 0 April 18th 05 03:11 PM
Adding a scrollbar in a single cell on worksheet [email protected] Excel Programming 2 March 11th 05 08:28 PM
Scrollbar junx13[_11_] Excel Programming 0 September 20th 04 08:03 AM


All times are GMT +1. The time now is 09:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"