AW: aus UF in Tabelle einfügen
21.05.2020 08:26:49
Hajo_Zi
Option Explicit
Private Sub CommandButton1_Click()
With Worksheets("Tabelle2")
'If TextBox1.Text "" Then
[A1] = "Überlegt wurde der Besuch folgender Module:" '& Chr(10) & TextBox1.Text & Chr( _
10) & "Wochen" '& TextBox2.Text & Chr(10) & TextBox3.Text & Chr(10) & TextBox4.Text & Chr(10)
[A1] = Application.Substitute([A1], Chr(10), " ")
Range("A2:A8").ClearContents
'Mod1
If TextBox1.Text "" Then
[A2] = "Modul1" & Chr(10) & TextBox1.Text & Chr(10) & "Woche/n"
[A2] = Application.Substitute([A2], Chr(10), " ")
End If
'Mod2
If TextBox2.Text "" Then
[A3] = "Modul2" & Chr(10) & TextBox2.Text & Chr(10) & Chr(10) & "Woche/n"
[A3] = Application.Substitute([A3], Chr(10), " ")
End If
'Mod3
If TextBox3.Text "" Then
[A4] = "Modul3" & Chr(10) & TextBox3.Text & Chr(10) & Chr(10) & "Woche/n"
[A4] = Application.Substitute([A4], Chr(10), " ")
End If
'Mod4
If TextBox4.Text "" Then
[A5] = "Modul4" & Chr(10) & TextBox4.Text & Chr(10) & Chr(10) & "Woche/n"
[A5] = Application.Substitute([A5], Chr(10), " ")
End If
'Mod 5
If TextBox5.Text "" Then
[A6] = "Modul5" & Chr(10) & TextBox5.Text & Chr(10) & Chr(10) & "Woche/n"
[A6] = Application.Substitute([A6], Chr(10), " ")
End If
'Mod 6
If TextBox6.Text "" Then
[A7] = "Modul6" & Chr(10) & TextBox6.Text & Chr(10) & Chr(10) & "Woche/n"
[A7] = Application.Substitute([A7], Chr(10), " ")
End If
'Mod 7
If TextBox7.Text "" Then
[A8] = "Modul7" & Chr(10) & TextBox7.Text & Chr(10) & Chr(10) & "Woche/n"
[A8] = Application.Substitute([A8], Chr(10), " ")
End If
End With
End Sub