na wenn das so ist :e@sy
irgendwie gehts mir heute nich so gut... heute code ich hier einen mist zusammen:
Sub CreateCharts(strRange As String, bolPie As Boolean, strSheet As String, strChartName As String _
, Anfang As Integer, Ende As Integer, strTitle As String, intCol2 As Integer, intRow2 As Integer, intSub As Integer)
Dim intRow As Integer, intCol As Integer
intRow = intRow2
intCol = intCol2
[...]
If strSheet = "C" Then
Do While Tabelle3.Cells(intRow, intCol) <> ""
intRow = intRow + 1
Loop
intRow = intRow - 2
intCol = intCol + 1
ActiveChart.SetSourceData Source:=Sheets("C Pivots").Range(Chr(64 + intCol2) & intRow2 & ":" & Chr(64 + intCol) & intRow), PlotBy:=xlColumns
Else
Do While Tabelle4.Cells(intRow, intCol) <> ""
intRow = intRow + 1
Loop
Do While Tabelle4.Cells(intRow - 1, intCol) <> ""
intCol = intCol + 1
If intCol >= 27 Then
intCol = intCol - 27
Do While Tabelle4.Cells(intRow, 26 + intCol) <> ""
intCol = intCol + 1
If intCol >= 27 Then
intCol = intCol - 27
Do While Tabelle4.Cells(intRow, 52 + intCol) <> ""
intCol = intCol + 1
Loop
intCol = intCol + 52
ActiveChart.SetSourceData Source:=Sheets("P Pivots").Range(Chr(64 + intCol2) & intRow2 + 2 & ":" & "B" & Chr(64 + intCol) & intRow - 2), PlotBy:=xlColumns
Exit Do
Exit Do
End If
Loop
intCol = intCol + 26
ActiveChart.SetSourceData Source:=Sheets("P Pivots").Range(Chr(64 + intCol2) & intRow2 + 2 & ":" & "A" & Chr(64 + intCol) & intRow - 2), PlotBy:=xlColumns
Exit Do
End If
ActiveChart.SetSourceData Source:=Sheets("P Pivots").Range(Chr(64 + intCol2) & intRow2 - intSub + 1 & ":" & Chr(64 + intCol - (2 * intSub) + 2) & intRow - 2), PlotBy:=xlColumns
Loop
End If
[...]
End Sub
[/PHP]
sieht hier jemand was wie man das vereinfachen kann?