Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Adjust a Scroll bar to fill in a range perfectly

Hi!!!
Sorry because I do not know the english name.
if you go to view/toolbox. there are many different controls. one of
then is similar to the ScrollBar located in ActiveX controls, "I
don't know the name anyway" my question is:"


How can Adjust this "ControlBox" to fill in a range "say
Range("C3:F3") perfectly.

My problem comes because the Scrollbox in ActiveX controls has a
property to change the resize the control size with the cells, but the
"ScrollBox from the Toolbox, again this is not a ScrollBox, but looks
similar, and I don't know the Englixh name, does not have this
property enabled.

So I need to use VBA to adjust this "ScrollBox to a Range.

The Same way, if I get a Shape and or one Image, how can Adjust this
images size to fill perfectly in a Range, useful if I want to adjust
my company's logotipe in a Range, some Logotipes are to big others so
small, I would like to create a Template, with a botton to get the
image from a File and once is teken "Already done", adjust it to the
range named Company_logotipe.

This is the same question but for a Shape and/or image!


Many Thanks!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Adjust a Scroll bar to fill in a range perfectly

Public Sub SetScrollBar()
Dim ws As Worksheet
Dim rng As Range
Dim sb1 As OLEObject

Set ws = ActiveSheet
Set rng = ws.Range("$C$3:$F$3")
Set sb1 = ws.OLEObjects("ScrollBar1")

With sb1
'Set the upper-left corner of the scroll bar to the range.
.Top = rng.Top
.Left = rng.Left

'Now set the height and width of the scroll bar.
.Height = rng.Height
.Width = rng.Width
End With
End Sub

--
Regards,
Bill


wrote in message
m...
Hi!!!
Sorry because I do not know the english name.
if you go to view/toolbox. there are many different controls. one of
then is similar to the ScrollBar located in ActiveX controls, "I
don't know the name anyway" my question is:"


How can Adjust this "ControlBox" to fill in a range "say
Range("C3:F3") perfectly.

My problem comes because the Scrollbox in ActiveX controls has a
property to change the resize the control size with the cells, but the
"ScrollBox from the Toolbox, again this is not a ScrollBox, but looks
similar, and I don't know the Englixh name, does not have this
property enabled.

So I need to use VBA to adjust this "ScrollBox to a Range.

The Same way, if I get a Shape and or one Image, how can Adjust this
images size to fill perfectly in a Range, useful if I want to adjust
my company's logotipe in a Range, some Logotipes are to big others so
small, I would like to create a Template, with a botton to get the
image from a File and once is teken "Already done", adjust it to the
range named Company_logotipe.

This is the same question but for a Shape and/or image!


Many 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
Is it possible or impossible to auto adjust range in a formula? vadda Excel Discussion (Misc queries) 0 October 15th 08 09:22 PM
excell 2003 -how to use a scroll bar to adjust the range of a func tom Excel Discussion (Misc queries) 2 August 17th 08 01:54 PM
adjust the range in a long column of formulas to accomodate new da Shannon Excel Worksheet Functions 2 August 11th 06 11:00 PM
How to have a chart automatically adjust range as I add data entr. AdamCPTD Charts and Charting in Excel 1 July 6th 06 09:36 PM
Adjust Range in Function pomalley Excel Worksheet Functions 1 December 29th 05 01:29 AM


All times are GMT +1. The time now is 04:41 AM.

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

About Us

"It's about Microsoft Excel"