AW: hier ist die Datei...
03.08.2009 21:38:20
Peter
Hallo Tino,
eine bitte hätte ich noch,
Diese ganze Sache ist ja in eine große datei eingebunden
Die Daten stehen in Tabelle15 das Diagramm in Tabelle18 und der Button die userform auf zurufen steht in der Tabelle1. Die beiden Tabellen15 und 18 sind ausgeblendet.
Habe den Code soweit geändert, aber wenn ich jetzt die Userform aufrufe wird mir die Combox1 und 2 befüllt das Diagramm angezeigt nur die Istwerte und erledigte Datensätze in den Label wird mir nicht angezeigt
Wo habe ich was vergessen?
Option Explicit
Dim strPfad As String
Private Sub FuellLabel()
Dim varRow, varCol
Dim booVisible As Boolean
With Application
If IsNumeric(ComboBox1) And ComboBox1 "" And ComboBox2 "" Then
varRow = .Match(ComboBox1 * 1, Tabelle15.Columns(1), 0)
varCol = .Match(ComboBox2, Tabelle15.Rows(1), 0)
If IsNumeric(varRow) And IsNumeric(varCol) Then
Label5.Caption = .Cells(2, varCol)
Label6.Caption = .Cells(varRow, varCol)
With Tabelle18
.Cells(1, 1) = Tabelle15.Cells(1, 1)
.Cells(1, 2) = Tabelle15.Cells(2, 1)
.Cells(2, 1) = Tabelle15.Cells(1, varCol)
.Cells(2, 2) = Tabelle15.Cells(2, varCol)
.Cells(2, 3) = Tabelle15.Cells(varRow, varCol)
Call LoadDiagramm(False)
End With
booVisible = True
End If
End If
If booVisible Then
Image1.Visible = True
Else
Image1.Visible = False
Label5.Caption = ""
Label6.Caption = ""
End If
End With
Call LoadDiagramm
End Sub
Private Sub ComboBox1_Change()
Call FuellLabel
End Sub
Private Sub ComboBox2_Change()
Call FuellLabel
End Sub
Private Sub UserForm_Initialize()
Dim myAr
Image1.Visible = False
With Tabelle15
myAr = .Range("A3", .Cells(.Rows.Count, 1).End(xlUp))
ComboBox1.List = myAr
myAr = Application.Transpose(.Range("B1", .Cells(1, .Columns.Count).End(xlToLeft)))
ComboBox2.List = myAr
End With
End Sub
Private Sub LoadDiagramm(Optional booKill As Boolean = True)
Dim Diagramm As Chart
strPfad = ThisWorkbook.Path
strPfad = IIf(Right(strPfad, 1) = "\", strPfad, strPfad & "\")
strPfad = strPfad & "DiaImage.gif"
If Not booKill Then
Set Diagramm = Tabelle18.ChartObjects(1).Chart
Diagramm.Parent.Width = Image1.Width
Diagramm.Parent.Height = Image1.Height
Diagramm.Export Filename:=strPfad, FilterName:="GIF"
Image1.Picture = LoadPicture(strPfad)
Else
On Error Resume Next
Kill strPfad
On Error GoTo 0
End If
End Sub
Gruß Peter