Gute Idee - Danke.
Hier der Link:
https://www.dropbox.com/s/sccc6vx9ygi7q1d/Unionhttps://www.dropbox.com/s/sccc6vx9ygi7q1d/Union.xlsm?dl=0.xlsm?dl=0
und hier der Code nochmal:
Option Explicit
Private Sub Button_übernehmen_Click()
Dim x As Long
Dim max As Long
For x = 1 To 366 'erste leere Zeile finden und in max speichern
ThisWorkbook.Sheets("GESAMT").Cells(x, 2) = TextBox_GESAMT.Text
If ThisWorkbook.Sheets("GESAMT").Cells(x, 2) <> "" Then
Else: ThisWorkbook.Sheets("GESAMT").Cells(x + 1, 2) = TextBox_GESAMT.Value
ThisWorkbook.Sheets("GESAMT").Cells(x, 5) = TextBox_UniProfiRente.Text
If ThisWorkbook.Sheets("GESAMT").Cells(x, 5) <> "" Then
Else: ThisWorkbook.Sheets("GESAMT").Cells(x + 1, 5) = TextBox_UniProfiRente.Value
ThisWorkbook.Sheets("GESAMT").Cells(x, 8) = TextBox_UniFonds.Text
If ThisWorkbook.Sheets("GESAMT").Cells(x, 8) <> "" Then
Else: ThisWorkbook.Sheets("GESAMT").Cells(x + 1, 8) = TextBox_UniFonds.Value
ThisWorkbook.Sheets("GESAMT").Cells(x, 11) = TextBox_PrivatFonds.Text
If ThisWorkbook.Sheets("GESAMT").Cells(x, 11) <> "" Then
Else: ThisWorkbook.Sheets("GESAMT").Cells(x + 1, 11) = TextBox_PrivatFonds.Value
ThisWorkbook.Sheets("GESAMT").Cells(x, 14) = TextBox_UniRak.Text
If ThisWorkbook.Sheets("GESAMT").Cells(x, 14) <> "" Then
Else: ThisWorkbook.Sheets("GESAMT").Cells(x + 1, 14) = TextBox_UniRak.Value
ThisWorkbook.Sheets("GESAMT").Cells(x, 17) = TextBox_UniDividendenAss.Text
If ThisWorkbook.Sheets("GESAMT").Cells(x, 17) <> "" Then
Else: ThisWorkbook.Sheets("GESAMT").Cells(x + 1, 17) = TextBox_UniDividendenAss.Value
ThisWorkbook.Sheets("GESAMT").Cells(x, 20) = TextBox_UniFavorit.Text
If ThisWorkbook.Sheets("GESAMT").Cells(x, 20) <> "" Then
Else: ThisWorkbook.Sheets("GESAMT").Cells(x + 1, 20) = TextBox_UniFavorit.Value
ThisWorkbook.Sheets("GESAMT").Cells(x, 23) = TextBox_UniFonds2.Text
If ThisWorkbook.Sheets("GESAMT").Cells(x, 23) <> "" Then
Else: ThisWorkbook.Sheets("GESAMT").Cells(x + 1, 23) = TextBox_UniFonds2.Value
max = x
Exit For
End If
Next x
ActiveSheet.Cells(max, 2) = TextBox_GESAMT
ActiveSheet.Cells(max, 5) = TextBox_UniProfiRente
ActiveSheet.Cells(max, 8) = TextBox_UniFonds
ActiveSheet.Cells(max, 11) = TextBox_PrivatFonds
ActiveSheet.Cells(max, 14) = TextBox_UniRak
ActiveSheet.Cells(max, 17) = TextBox_UniDividendenAss
ActiveSheet.Cells(max, 20) = TextBox_UniFavorit
ActiveSheet.Cells(max, 23) = TextBox_UniFonds2
End Sub
Private Sub UserForm_Initialize()
'GESAMT
TextBox_GESAMT = "GESAMT eingeben"
'UniProfiRente
TextBox_UniProfiRente = "UniProfiRente eingeben"
'UniFonds
TextBox_UniFonds = "UniFonds eingeben"
'PrivatFonds
TextBox_PrivatFonds = "PrivatFonds___ Kontrolliert pro eingeben"
'UniRak
TextBox_UniRak = "UniRak -net- eingeben"
'UniDividendenAss
TextBox_UniDividendenAss = "UniDividendenAss -net- eingeben"
'UniFavorit
TextBox_UniFavorit = "UniFavorit___Aktien -net- eingeben"
'UniFonds2
TextBox_UniFonds2 = "UniFonds_2 eingeben"
End Sub
|