Lösungsvorschlag
04.09.2018 09:10:53
Beverly
Hi Fred,
versuche es mal damit (ich kann es leider nicht in Excel2003 testen):
Sub DiasErstellen()
Dim intSpalte As Integer
Dim lngLetzte As Long
Dim rngBereich As Range
For intSpalte = 1 To 19 Step 9
lngLetzte = Columns(intSpalte).Find(What:="*", SearchOrder:=xlByRows, SearchDirection:= _
xlPrevious).Row
Set rngBereich = Range(Cells(9, intSpalte + 1), Cells(lngLetzte, intSpalte + 5))
With ActiveSheet.ChartObjects.Add(0, 0, 0, 0).Chart
.ChartType = xlColumnStacked100
.SetSourceData Source:=rngBereich
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
With .Parent
.Top = 1
.Height = 150
.Width = 350
.Left = Cells(1, intSpalte).Left
End With
.SeriesCollection(1).XValues = rngBereich.Columns(1).Offset(0, -1)
End With
Next intSpalte
End Sub