Assigning macro to SCROLL BAR/SPIN BUTTON

AjinkyaG

New Member
Joined
Jun 20, 2019
Messages
15
HI,
I have X,Y,Z coordinates of points(10 points) on a line. This line changes according to Time.. for each time change line changes and points on it also changes. Suppose it changes 5 times So I will have 5 such XYZ values for those 10 points. I have data for each time pasted in different columns A,B,C,D.....in manner X,Y,Z,X,Y,Z and so on.. means X will be in Column A, Y will be in Column B, Z will be in Column C, Again for different time X will be in D, Y will be in E and so on, to plot those points I am using

Sub Chartone()
Dim cht As ChartObject




Range("A:A,B:B").Select


ActiveSheet.Shapes.AddChart2(269, xlBubble3DEffect).Select
ActiveChart.SetSourceData Source:=Range("Sheet2!$A:$A,Sheet2!$B:$B")

ActiveChart.Parent.Name = "TOPTime1"
Set cht = ActiveSheet.ChartObjects("TOPTime1")
cht.Chart.HasTitle = True
cht.Chart.ChartTitle.Text = "TOP-Time1"


With cht
.Top = Range("A100").Top
''.Width = Range("A1:G12").Width
''.Height = Range("A1:G12").Height
.Left = Range("A100").Left
End With
With ActiveSheet.ChartObjects("TOPTime1").Chart
.Axes(xlValue).MinimumScale = 5000
.Axes(xlValue).MaximumScale = 7000
.Axes(xlCategory).MinimumScale = 0
.Axes(xlCategory).MaximumScale = 1400
End With


Range("A:A,C:C").Select
ActiveSheet.Shapes.AddChart2(269, xlBubble3DEffect).Select
ActiveChart.SetSourceData Source:=Range("Sheet2!$A:$A,Sheet2!$C:$C")
ActiveChart.Parent.Name = "FrontTime1"

Set cht = ActiveSheet.ChartObjects("FrontTime1")
cht.Chart.HasTitle = True
cht.Chart.ChartTitle.Text = "Front-Time1"
With cht
.Top = Range("A114").Top
''.Width = Range("A1:G12").Width
''.Height = Range("A1:G12").Height
.Left = Range("A114").Left
End With
With ActiveSheet.ChartObjects("FrontTime1").Chart
.Axes(xlValue).MinimumScale = 0
.Axes(xlValue).MaximumScale = 1400
.Axes(xlCategory).MinimumScale = 0
.Axes(xlCategory).MaximumScale = 1400
End With




Range("B:B,C:C").Select
ActiveSheet.Shapes.AddChart2(269, xlBubble3DEffect).Select
ActiveChart.SetSourceData Source:=Range("Sheet2!$B:$B,Sheet2!$C:$C")
ActiveChart.Parent.Name = "SideTime1"
Set cht = ActiveSheet.ChartObjects("SideTime1")
cht.Chart.HasTitle = True
cht.Chart.ChartTitle.Text = "Side-Time1"
With cht
.Top = Range("I114").Top
''.Width = Range("A1:G12").Width
''.Height = Range("A1:G12").Height
.Left = Range("I114").Left
End With
With ActiveSheet.ChartObjects("SideTime1").Chart
.Axes(xlValue).MinimumScale = 0
.Axes(xlValue).MaximumScale = 1400
.Axes(xlCategory).MinimumScale = 5000
.Axes(xlCategory).MaximumScale = 7000
End With
End Sub


Here I am plotting XY,XZ,YZ using A,B,C columns..Again for next step XY,XZ,YZ using D,E,F columns..

I am interested to use Scroll bar or Spin button so that within same plot charts I can plot values for other time steps...Means I will have three charts__XY,XZ, and YZ..and in this charts by scrolling bar or button I will change Steps..So instead of plotting 15 charts in 3 charts(XY,XZ,YZ) it will be done by changing the scroll button or spinning it..
(plot axes ranges will be same)
Please help me in doing this thing??
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,214,568
Messages
6,120,278
Members
448,953
Latest member
Dutchie_1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top