Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add Spin Button to change a selected range for use in a chart

Status
Not open for further replies.

remeng

Technical User
Jul 27, 2006
523
US
Hi guys,

I would like to make a range such as B4:B31 change columns by one column increments by way of a spin button. This will be used for a line graph. Additionally, the same spin button should also change range B36:B63. Is there a way to do this and if so how?

Additional Information:

range B4:B31 is series1

range B36:B63 is series2

there are over 140 columns that need to be switched between

The graph will be in the same sheet as the data


Thanks all
 




Hi,

I assume a MS Form Spinner, named spnCol
Code:
'range B4:B31 is series1
'range B36:B63 is series2
dim rng1 as range, rng2 as range, iCol as integer
iCol = YourSheetObject.Shapes("spnCol").oleformat.object.value
set rng1 = range(cells(4, iCol), cells(31, iCol))
set rng2 = range(cells(36, iCol), cells(63, iCol))


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top