K
keawee
Hello,
I would like to have a council of your share. I used the Macro mode to
create a graph. I inserted this macro in the page of code of my sheet1.
I inserted the name of my procedure in Worksheet_Activate and as soon
as I click on my sheet1, then my procedure this regenerate constantly.
My procedure is carried out in loop and I do not manage to stop it.
How to make for to execute that one alone time at the time of the
opening of my sheet in my sorter?.
In addition, it is possible to remove all the graph during the closing
of an Excel file. I know Workbook_Open but there is not Workbook_Close.
Is what there is a technique?.
Thanks for your help
This is my code:
Sub WorkSheet_Activate()
MyChart
End Sub
Sub MyChart()
Charts.Add
ActiveChart.ChartType = xl3DColumnClustered
ActiveChart.SetSourceData Source:=Sheets("
Menue").Range( _
"A12:B13,A26:B27"), PlotBy:=xlRows
ActiveChart.Location Where:=xlLocationAsObject,
Name:="Menue"
With ActiveChart
.Parent.Name = "TheParc"
.HasTitle = True
.ChartTitle.Characters.Text = "Les Parc"
.Axes(xlCategory).HasTitle = False
.Axes(xlSeries).HasTitle = False
.Axes(xlValue).HasTitle = False
End With
With ActiveChart
.HasAxis(xlCategory) = False
.HasAxis(xlSeries) = False
.HasAxis(xlValue) = True
End With
ActiveChart.Axes(xlCategory).CategoryType = xlAutomatic
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlSeries)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
ActiveChart.WallsAndGridlines2D = False
ActiveChart.ApplyDataLabels
Type:=xlDataLabelsShowNone, LegendKey:=False
End Sub
I would like to have a council of your share. I used the Macro mode to
create a graph. I inserted this macro in the page of code of my sheet1.
I inserted the name of my procedure in Worksheet_Activate and as soon
as I click on my sheet1, then my procedure this regenerate constantly.
My procedure is carried out in loop and I do not manage to stop it.
How to make for to execute that one alone time at the time of the
opening of my sheet in my sorter?.
In addition, it is possible to remove all the graph during the closing
of an Excel file. I know Workbook_Open but there is not Workbook_Close.
Is what there is a technique?.
Thanks for your help
This is my code:
Sub WorkSheet_Activate()
MyChart
End Sub
Sub MyChart()
Charts.Add
ActiveChart.ChartType = xl3DColumnClustered
ActiveChart.SetSourceData Source:=Sheets("
Menue").Range( _
"A12:B13,A26:B27"), PlotBy:=xlRows
ActiveChart.Location Where:=xlLocationAsObject,
Name:="Menue"
With ActiveChart
.Parent.Name = "TheParc"
.HasTitle = True
.ChartTitle.Characters.Text = "Les Parc"
.Axes(xlCategory).HasTitle = False
.Axes(xlSeries).HasTitle = False
.Axes(xlValue).HasTitle = False
End With
With ActiveChart
.HasAxis(xlCategory) = False
.HasAxis(xlSeries) = False
.HasAxis(xlValue) = True
End With
ActiveChart.Axes(xlCategory).CategoryType = xlAutomatic
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlSeries)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
ActiveChart.WallsAndGridlines2D = False
ActiveChart.ApplyDataLabels
Type:=xlDataLabelsShowNone, LegendKey:=False
End Sub