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??
 

Some videos you may like

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Watch MrExcel Video

Forum statistics

Threads
1,101,928
Messages
5,483,748
Members
407,408
Latest member
chandika

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top