' -------------------- continuo a sistemare l'intestazione del Foglio4 --------------------
' -------------------- faccio grafici istogrammi in lineare --------------------
Sheets("Foglio4").Select
' elimino le colonne "classi" ridondanti nel Foglio4 per le statistiche descrittive
elimincol = 3
For i = 1 To numeroROI
Columns(elimincol).Delete Shift:=xlToLeft
elimincol = elimincol + 1
Next i
' eliminazione due righe superiori
Rows("1:2").Delete Shift:=xlUp
' copio la colonna dei nomi delle ROI e la incollo nella intestazione
Sheets("Foglio1").Select
Range(Cells(3, 2), Cells((numeroROI + 2), 2)).Copy
Sheets("Foglio4").Select
Cells(1, 2).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
' colorare le righe di grigio
Range(Cells(1, 1), Cells(1, 1 + numeroROI)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.149998474074526
.PatternTintAndShade = 0
End With
' ridimensiona larghezza colonne
Columns(1).ColumnWidth = 22
' posizionamento dei istogrammi, questa sezione mette i grafici in Foglio4
nomeROI = 3
numeroColonna = 10
For v = 1 To numeroROI
x = (v - 1) Mod 4
y = Int((v - 1) / 4)
x_iniz_graf = 100 + x * 300
y_iniz_graf = 300 + y * 200
' grafici
Sheets("Foglio4").Select
ActiveSheet.Shapes.AddChart(xlColumnStacked, Left:=x_iniz_graf, Top:=y_iniz_graf, Width:=300, Height:=200).Select
With ActiveChart
.HasTitle = True
.SeriesCollection.NewSeries
'.ChartTitle.Text = Worksheets("Foglio1").Range(Worksheets("Foglio1").Cells(nomeROI, 2))
.SeriesCollection(1).Select
With Selection
.Name = "=""Freq"""
.XValues = Worksheets("Foglio2").Range(Worksheets("Foglio2").Cells(3, 9), Worksheets("Foglio2").Cells(102, 9))
.Values = Worksheets("Foglio2").Range(Worksheets("Foglio2").Cells(3, numeroColonna), Worksheets("Foglio2").Cells(102, numeroColonna))
End With
.Legend.Delete 'non mette il nome alle serie
.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
Selection.Caption = "Classe"
.SetElement (msoElementPrimaryValueAxisTitleRotated)
Selection.Caption = "Freq"
End With
nomeROI = nomeROI + 1
numeroColonna = numeroColonna + 1
Next v
' -------------------- faccio grafici istogrammi in dB --------------------
' posizionamento dei istogrammi, questa sezione mette i grafici in Foglio5
Sheets("Foglio5").Select
Cells(3, 10).Value = "ISTOGRAMMI IN dB"
nomeROI = 3
numeroColonna = 10
For v = 1 To numeroROI
x = (v - 1) Mod 4
y = Int((v - 1) / 4)
x_iniz_graf = 100 + x * 300
y_iniz_graf = 100 + y * 200
' grafici
ActiveSheet.Shapes.AddChart(xlColumnStacked, Left:=x_iniz_graf, Top:=y_iniz_graf, Width:=300, Height:=200).Select
With ActiveChart
.HasTitle = True
.SeriesCollection.NewSeries
.ChartTitle.Text = Worksheets("Foglio1").Cells(nomeROI, 2)
.SeriesCollection(1).Select
With Selection
.Name = "=""Freq"""
.XValues = Worksheets("Foglio3").Range(Worksheets("Foglio3").Cells(3, 9), Worksheets("Foglio3").Cells(102, 9))
.Values = Worksheets("Foglio3").Range(Worksheets("Foglio3").Cells(3, numeroColonna), Worksheets("Foglio3").Cells(102, numeroColonna))
End With
.Legend.Delete 'non mette il nome alle serie
.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
Selection.Caption = "Classe"
.SetElement (msoElementPrimaryValueAxisTitleRotated)
Selection.Caption = "Freq"
End With
nomeROI = nomeROI + 1
numeroColonna = numeroColonna + 1
Next v |