Hallo Chris!!!
Code 1:
Private Sub CommandButton1_Click()
Range("AB34").Value = TextBox1.Value
Range("AB35").Value = TextBox2.Value
Range("AB36").Value = TextBox3.Value
Range("AB37").Value = TextBox4.Value
Range("AB38").Value = TextBox5.Value
Range("AB39").Value = TextBox6.Value
Range("AB40").Value = TextBox7.Value
Range("AB41").Value = TextBox8.Value
Range("AB42").Value = TextBox9.Value
Range("AB43").Value = TextBox10.Value
Range("AB44").Value = TextBox11.Value
Range("AB45").Value = TextBox12.Value
If TextBox16 = "" Then
Range("AC34").Value = TextBox16.Value
Else
Range("AC34").Value = TextBox16.Value * 1
End If
If TextBox17 = "" Then
Range("AC35").Value = TextBox17.Value
Else
Range("AC35").Value = TextBox17.Value * 1
End If
If TextBox18 = "" Then
Range("AC36").Value = TextBox18.Value
Else
Range("AC36").Value = TextBox18.Value * 1
End If
If TextBox19 = "" Then
Range("AC37").Value = TextBox19.Value
Else
Range("AC37").Value = TextBox19.Value * 1
End If
If TextBox20 = "" Then
Range("AC38").Value = TextBox20.Value
Else
Range("AC38").Value = TextBox20.Value * 1
End If
If TextBox21 = "" Then
Range("AC39").Value = TextBox21.Value
Else
Range("AC39").Value = TextBox21.Value * 1
End If
If TextBox22 = "" Then
Range("AC40").Value = TextBox22.Value
Else
Range("AC40").Value = TextBox22.Value * 1
End If
If TextBox23 = "" Then
Range("AC41").Value = TextBox23.Value
Else
Range("AC41").Value = TextBox23.Value * 1
End If
If TextBox24 = "" Then
Range("AC42").Value = TextBox24.Value
Else
Range("AC42").Value = TextBox24.Value * 1
End If
If TextBox25 = "" Then
Range("AC43").Value = TextBox25.Value
Else
Range("AC43").Value = TextBox25.Value * 1
End If
If TextBox26 = "" Then
Range("AC44").Value = TextBox26.Value
Else
Range("AC44").Value = TextBox26.Value * 1
End If
If TextBox27 = "" Then
Range("AC45").Value = TextBox27.Value
Else
Range("AC45").Value = TextBox27.Value * 1
End If
Unload Me
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub CommandButton3_Click()
Unload Me
Range("A1").Select
ActiveWindow.SmallScroll Down:=30
ActiveWindow.SmallScroll ToRight:=26
Range("AA31").Select
End Sub
Private Sub TextBox16_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox16.Value = Format(TextBox16.Value, "#,##0.00 ")
End Sub
Private Sub TextBox17_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox17.Value = Format(TextBox17.Value, "#,##0.00 ")
End Sub
Private Sub TextBox18_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox18.Value = Format(TextBox18.Value, "#,##0.00 ")
End Sub
Private Sub TextBox19_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox19.Value = Format(TextBox19.Value, "#,##0.00 ")
End Sub
Private Sub TextBox20_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox20.Value = Format(TextBox20.Value, "#,##0.00 ")
End Sub
Private Sub TextBox21_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox21.Value = Format(TextBox21.Value, "#,##0.00 ")
End Sub
Private Sub TextBox22_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox22.Value = Format(TextBox22.Value, "#,##0.00 ")
End Sub
Private Sub TextBox23_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox23.Value = Format(TextBox23.Value, "#,##0.00 ")
End Sub
Private Sub TextBox24_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox24.Value = Format(TextBox24.Value, "#,##0.00 ")
End Sub
Private Sub TextBox25_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox25.Value = Format(TextBox25.Value, "#,##0.00 ")
End Sub
Private Sub TextBox26_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox26.Value = Format(TextBox26.Value, "#,##0.00 ")
End Sub
Private Sub TextBox27_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox27.Value = Format(TextBox27.Value, "#,##0.00 ")
End Sub
Private Sub CommandButton4_Click()
frmZeitraum_Tabelle3.Show
End Sub
Private Sub CommandButton5_Click()
ActiveWindow.SelectedSheets.PrintOut From:=18, To:=18, Copies:=1, Collate _
:=True
Unload Me
End Sub
Private Sub UserForm_Initialize()
Dim tblKrankheitskosten As Worksheet
Set tblKrankheitskosten = Worksheets("Krankheitskosten")
'Titel der UserForm
frm001_Tabelle3.Caption = Sheets("Krankheitskosten").Cells(31, 20).Value
'Beschriftungen für die Bezeichnungsfelder aus Tabelle holen
With frm001_Tabelle3
.Label1.Caption = tblKrankheitskosten.Cells(32, 27).Value
.Label2.Caption = tblKrankheitskosten.Cells(32, 28).Value
.Label3.Caption = tblKrankheitskosten.Cells(32, 29).Value
End With
Me.TextBox1 = tblKrankheitskosten.Cells(34, 28).Text
Me.TextBox2 = tblKrankheitskosten.Cells(35, 28).Text
Me.TextBox3 = tblKrankheitskosten.Cells(36, 28).Text
Me.TextBox4 = tblKrankheitskosten.Cells(37, 28).Text
Me.TextBox5 = tblKrankheitskosten.Cells(38, 28).Text
Me.TextBox6 = tblKrankheitskosten.Cells(39, 28).Text
Me.TextBox7 = tblKrankheitskosten.Cells(40, 28).Text
Me.TextBox8 = tblKrankheitskosten.Cells(41, 28).Text
Me.TextBox9 = tblKrankheitskosten.Cells(42, 28).Text
Me.TextBox10 = tblKrankheitskosten.Cells(43, 28).Text
Me.TextBox11 = tblKrankheitskosten.Cells(44, 28).Text
Me.TextBox12 = tblKrankheitskosten.Cells(45, 28).Text
Me.TextBox16 = tblKrankheitskosten.Cells(34, 29).Text
Me.TextBox17 = tblKrankheitskosten.Cells(35, 29).Text
Me.TextBox18 = tblKrankheitskosten.Cells(36, 29).Text
Me.TextBox19 = tblKrankheitskosten.Cells(37, 29).Text
Me.TextBox20 = tblKrankheitskosten.Cells(38, 29).Text
Me.TextBox21 = tblKrankheitskosten.Cells(39, 29).Text
Me.TextBox22 = tblKrankheitskosten.Cells(40, 29).Text
Me.TextBox23 = tblKrankheitskosten.Cells(41, 29).Text
Me.TextBox24 = tblKrankheitskosten.Cells(42, 29).Text
Me.TextBox25 = tblKrankheitskosten.Cells(43, 29).Text
Me.TextBox26 = tblKrankheitskosten.Cells(44, 29).Text
Me.TextBox27 = tblKrankheitskosten.Cells(45, 29).Text
Me.TextBox31 = tblKrankheitskosten.Cells(34, 27).Text
Me.TextBox32 = tblKrankheitskosten.Cells(35, 27).Text
Me.TextBox33 = tblKrankheitskosten.Cells(36, 27).Text
Me.TextBox34 = tblKrankheitskosten.Cells(37, 27).Text
Me.TextBox35 = tblKrankheitskosten.Cells(38, 27).Text
Me.TextBox36 = tblKrankheitskosten.Cells(39, 27).Text
Me.TextBox37 = tblKrankheitskosten.Cells(40, 27).Text
Me.TextBox38 = tblKrankheitskosten.Cells(41, 27).Text
Me.TextBox39 = tblKrankheitskosten.Cells(42, 27).Text
Me.TextBox40 = tblKrankheitskosten.Cells(43, 27).Text
Me.TextBox41 = tblKrankheitskosten.Cells(44, 27).Text
Me.TextBox42 = tblKrankheitskosten.Cells(45, 27).Text
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
frm001_Arzt.OptionButton1 = False
frm001_Arzt.OptionButton2 = False
frm001_Arzt.OptionButton3 = False
frm001_Arzt.OptionButton4 = False
frm001_Arzt.OptionButton5 = False
frm001_Arzt.OptionButton6 = False
frm001_Arzt.OptionButton7 = False
frm001_Arzt.OptionButton8 = False
frm001_Arzt.Hide
ActiveSheet.Range("A1").Select
End Sub
Private Sub UserForm_Activate()
Dim i As Integer
For i = 1 To 12
If Me("Textbox" & i) = "" Then
Me("Textbox" & i).SetFocus
Exit For
End If
Next i
End Sub
Code 2:
Private Sub CommandButton1_Click()
Range("AT34").Value = TextBox1.Value
Range("AT35").Value = TextBox2.Value
Range("AT36").Value = TextBox3.Value
Range("AT37").Value = TextBox4.Value
Range("AT38").Value = TextBox5.Value
Range("AT39").Value = TextBox6.Value
Range("AT40").Value = TextBox7.Value
Range("AT41").Value = TextBox8.Value
Range("AT42").Value = TextBox9.Value
Range("AT43").Value = TextBox10.Value
Range("AT44").Value = TextBox11.Value
Range("AT45").Value = TextBox12.Value
Range("AV34").Value = TextBox13.Value
Range("AV35").Value = TextBox14.Value
Range("AV36").Value = TextBox15.Value
Range("AV37").Value = TextBox16.Value
Range("AV38").Value = TextBox17.Value
Range("AV39").Value = TextBox18.Value
Range("AV40").Value = TextBox19.Value
Range("AV41").Value = TextBox20.Value
Range("AV42").Value = TextBox21.Value
Range("AV43").Value = TextBox22.Value
Range("AV44").Value = TextBox23.Value
Range("AV45").Value = TextBox24.Value
Unload Me
frm001_Tabelle3.Hide
frm001_Arzt.Hide
frm001_Tabelle3.Show vbModeless
End Sub
Die eingetragenen Werte der UF 2, sollen gleich bei Wiedereröffnung der UF 1 in dieser erscheinen!!!
Kannmst du jetzt damit etwas anfangen?
Danke im übrigen schon einmal für deine Mühe und Geduld mit mir!!!
Gruß Frank H!!!