J
jlaufs
Hello,
I would to do the following in a Excel Macro:
I want to move a Button to right above the X-Axis of my chart.
This ist my code so far. No matter what I try, the button never
appears directly above the axis, but some inches higher.
What is my mistake?
ActiveSheet.ChartObjects("Diagramm").Activate
ActiveChart.PlotArea.Select
ActiveChart.Axes(xlCategory).Select
'Achse
achselinks = Selection.Left
achseoben = Selection.Top
'Plot
ActiveSheet.ChartObjects("Diagramm").Select
ActiveChart.PlotArea.Select
plotlinks = Selection.Left
plotoben = Selection.Top
'Chartobject
ActiveSheet.ChartObjects("Diagramm").Select
ActiveChart.ChartArea.Select
chartlinks = Selection.Left
chartoben = Selection.Top
'Hier wird der Button verschoeben
ActiveSheet.Shapes("Button").Select
ActiveSheet.Shapes("Button").Top = plotoben + achseoben +
chartoben
ActiveSheet.Shapes("Button").Left = achselinks + chartlinks
Thanks a lot!
Johannes
I would to do the following in a Excel Macro:
I want to move a Button to right above the X-Axis of my chart.
This ist my code so far. No matter what I try, the button never
appears directly above the axis, but some inches higher.
What is my mistake?
ActiveSheet.ChartObjects("Diagramm").Activate
ActiveChart.PlotArea.Select
ActiveChart.Axes(xlCategory).Select
'Achse
achselinks = Selection.Left
achseoben = Selection.Top
'Plot
ActiveSheet.ChartObjects("Diagramm").Select
ActiveChart.PlotArea.Select
plotlinks = Selection.Left
plotoben = Selection.Top
'Chartobject
ActiveSheet.ChartObjects("Diagramm").Select
ActiveChart.ChartArea.Select
chartlinks = Selection.Left
chartoben = Selection.Top
'Hier wird der Button verschoeben
ActiveSheet.Shapes("Button").Select
ActiveSheet.Shapes("Button").Top = plotoben + achseoben +
chartoben
ActiveSheet.Shapes("Button").Left = achselinks + chartlinks
Thanks a lot!
Johannes