AW: Fehler 6 "Überlauf"
08.11.2017 16:56:07
Bernd
Hallo Peter,
Schön, das du mir helfen möchtest.
Mein Code:
Private Sub UserForm_Initialize()
Dim tblDepot As Worksheet
Dim strName As String
Set tblDepot = Worksheets("Depot")
With frm_Start
Label25.Caption = Format(Date, "dddd,") & " " & "den " & " " & Format(Date, "dd.mm.yyyy")
Label26.Caption = "Gesamt-" & Worksheets("Depot").Range("L1").Text
Label27.Caption = "Gewinn/-Verlust "
Label44.Caption = "Gewinn/-Verlust %"
.Label28.Caption = tblDepot.Cells(1, 1).Value
.Label29.Caption = tblDepot.Cells(1, 2).Value
.Label30.Caption = tblDepot.Cells(1, 3).Value
.Label31.Caption = tblDepot.Cells(1, 4).Value
.Label32.Caption = tblDepot.Cells(1, 5).Value
.Label33.Caption = tblDepot.Cells(1, 6).Value
.Label34.Caption = tblDepot.Cells(1, 7).Value
.Label35.Caption = tblDepot.Cells(1, 8).Value
.Label36.Caption = tblDepot.Cells(1, 9).Value
.Label37.Caption = tblDepot.Cells(1, 10).Value
.Label38.Caption = tblDepot.Cells(1, 11).Value
.Label39.Caption = tblDepot.Cells(1, 12).Value
.Label40.Caption = tblDepot.Cells(1, 13).Value
.Label41.Caption = tblDepot.Cells(1, 14).Value
End With
With Worksheets("Depot")
Dim Zeile
Zeile = Cells(Rows.Count, 1).End(xlUp).Row
TextBox26 = Format(Application.Sum(.Columns(12)), "#,##0.00 ")
TextBox27 = Format(Application.Sum(.Columns(13)), "#,##0.00 ")
TextBox28 = Format(TextBox27.Value / TextBox26.Value, "0.00 %")
With ListBox1
.ColumnCount = 16
.ColumnWidths = "3,4cm;1,8cm;1,1cm;1,1cm;1,8cm;2,8cm;1,5cm;2,8cm;1,8cm;1,5cm;2cm;2cm; _
1,8cm;1,4cm;2,1cm;1cm"
.ColumnHeads = False
.Font.Size = 10
.RowSource = "Depot!A2:P2" & Zeile
.ListIndex = 0
End With
End With
End Sub
Lieben Gruß Bernd