AW: VBA: Ergebnis in neuer Spalte
25.06.2014 18:18:13
fcs
Hallo Andreas,
wenn die Ergebnisse auf dem Label zeilenweise angezeigt werden sollen, dann so
For i = 1 To Aktienzahl
ActiveWorkbook.ActiveSheet.Cells(4, Aktienzahl + i + 8) = "Aktie" & i
ActiveWorkbook.ActiveSheet.Cells(5, Aktienzahl + i + 8) = Gewichtung(i, Max)
Ausgabe.Label1.Caption = Ausgabe.Label1.Caption & vbLf & Gewichtung(i, Max)
Next i
'oder evtl. auch so
Dim strLabel As String
strLabel = "Gewichtete Werte"
For i = 1 To Aktienzahl
ActiveWorkbook.ActiveSheet.Cells(4, Aktienzahl + i + 8) = "Aktie" & i
ActiveWorkbook.ActiveSheet.Cells(5, Aktienzahl + i + 8) = Gewichtung(i, Max)
strLabel = strLabel & vbLf & "Aktie " & i & " : " & Gewichtung(i, Max)
Next i
Ausgabe.Label1.Caption = strLabel
Die Höhe des Label-Steuerelements muss dann so eingestellt werden, dass alle Aktien angezeigt werden.
Hier isr ggf. eine Textbox (mit Multiline=True und vertikalem Scrollbalken, Locked=True) für die Darstellung besser geeignet.
Gruß
Franz