Hallo Hajo,
sollte ich die Mappe hochladen, meintest Du das? Dann habe ich Dich nicht verstanden...SORRY. Die Mappe ist aber 432KB groß, und somit leider nicht zum Upload geeignet. Zudem stehen die Daten in einer zweiten Mappe, die schon 2,5MB groß ist. kann ich den Code hier nicht dann besser posten?Mache ich mal einfach, hier der gesamte Code der in meiner UF steht zum Daten einlesen, ändern und wieder abspeichern.
Option Compare Text
Private Sub CommandButton2_Click()
UFTIP1.Show
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
UFStop.Show
Cancel = True
End If
End Sub
Private Sub CommandButton1_Click()
'beenden
ActiveWorkbook.Saved = True
ActiveWorkbook.Close
Unload Me
Application.ScreenUpdating = True
End Sub
Private Sub cmdDelete_Click()
If Bew_bearbeiten.ComboBox1 = "" Then
UFDaten_wählen.Show
Else
Sheets("Bew_Dat").Rows(ComboBox1.ListIndex + 2).Delete
ActiveWorkbook.Save
End If
End Sub
Private Sub UserForm_Initialize()
Application.ScreenUpdating = False
Workbooks.Open Filename:=Sheets("Daten").Range("J2").Text
With ComboBox1
.RowSource = "Bew_Dat!A2:A1000" & Sheets("Bew_Dat").Cells(Rows.Count, 5).End(xlUp).Row
.ListIndex = Sheets("Bew_Dat").Range("IV2")
End With
With ComboBox6
.RowSource = "KK!A2:A1000" & Sheets("KK").Cells(Rows.Count, 5).End(xlUp).Row
With ComboBox9
.RowSource = "Ärzte!A2:A1000" & Sheets("Ärzte").Cells(Rows.Count, 5).End(xlUp).Row
With ComboBox10
.RowSource = "Ärzte!A2:A1000" & Sheets("Ärzte").Cells(Rows.Count, 5).End(xlUp).Row
End With
End With
End With
End Sub
Private Sub ComboBox1_Change()
On Error Resume Next
TextBox2 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 2))
TextBox3 = Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 4)
TextBox4 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 5))
TextBox5 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 33))
TextBox6 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 34))
TextBox7 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 35))
TextBox8 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 36))
TextBox9 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 37))
TextBox10 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 38))
TextBox11 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 39))
TextBox12 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 40))
TextBox13 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 41))
TextBox14 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 42))
TextBox15 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 43))
TextBox16 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 44))
TextBox17 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 18))
TextBox18 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 19))
TextBox19 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 26))
TextBox20 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 27))
TextBox21 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 20))
TextBox22 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 21))
TextBox23 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 22))
TextBox24 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 23))
TextBox25 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 24))
TextBox26 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 28))
TextBox27 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 29))
TextBox28 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 30))
TextBox29 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 31))
TextBox30 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 32))
TextBox31 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 10))
TextBox32 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 11))
TextBox33 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 12))
TextBox34 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 13))
TextBox35 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 14))
TextBox36 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 46))
TextBox37 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 47))
TextBox38 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 48))
TextBox39 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 49))
TextBox40 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 50))
TextBox41 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 51))
TextBox42 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 52))
TextBox43 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 53))
TextBox44 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 54))
ComboBox2 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 3))
ComboBox3 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 6))
ComboBox4 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 7))
ComboBox5 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 8))
ComboBox6 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 9))
ComboBox7 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 15))
ComboBox8 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 16))
ComboBox9 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 17))
ComboBox10 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 25))
ComboBox11 = Format(Sheets("Bew_Dat").Cells(ComboBox1.ListIndex + 2, 45))
End Sub
Private Sub cmdSave_Click()
If Bew_bearbeiten.ComboBox1 = "" Then
UFDaten_wählen.Show
Else
If Bew_bearbeiten.ComboBox8 = "" Then
UFWB.Show
Else
Sheets("Bew_Dat").Select
Worksheets("Bew_Dat").Activate
g = ComboBox1.ListIndex + 2
Cells(g, 2) = TextBox2.Value
Cells(g, 4) = TextBox3.Value
Cells(g, 5) = TextBox4.Value
Cells(g, 33) = TextBox5.Value
Cells(g, 34) = TextBox6.Value
Cells(g, 35) = TextBox7.Value
Cells(g, 36) = TextBox8.Value
Cells(g, 37) = TextBox9.Value
Cells(g, 38) = TextBox10.Value
Cells(g, 39) = TextBox11.Value
Cells(g, 40) = TextBox12.Value
Cells(g, 41) = TextBox13.Value
Cells(g, 42) = TextBox14.Value
Cells(g, 43) = TextBox15.Value
Cells(g, 44) = TextBox16.Value
Cells(g, 18) = TextBox17.Value
Cells(g, 19) = TextBox18.Value
Cells(g, 26) = TextBox19.Value
Cells(g, 27) = TextBox20.Value
Cells(g, 20) = TextBox21.Value
Cells(g, 21) = TextBox22.Value
Cells(g, 22) = TextBox23.Value
Cells(g, 23) = TextBox24.Value
Cells(g, 24) = TextBox25.Value
Cells(g, 28) = TextBox26.Value
Cells(g, 29) = TextBox27.Value
Cells(g, 30) = TextBox28.Value
Cells(g, 31) = TextBox29.Value
Cells(g, 32) = TextBox30.Value
Cells(g, 10) = TextBox31.Value
Cells(g, 11) = TextBox32.Value
Cells(g, 12) = TextBox33.Value
Cells(g, 13) = TextBox34.Value
Cells(g, 14) = TextBox35.Value
Cells(g, 46) = TextBox36.Value
Cells(g, 47) = TextBox37.Value
Cells(g, 48) = TextBox38.Value
Cells(g, 49) = TextBox39.Value
Cells(g, 50) = TextBox40.Value
Cells(g, 51) = TextBox41.Value
Cells(g, 52) = TextBox42.Value
Cells(g, 53) = TextBox43.Value
Cells(g, 54) = TextBox44.Value
Cells(g, 3) = ComboBox2.Value
Cells(g, 6) = ComboBox3.Value
Cells(g, 7) = ComboBox4.Value
Cells(g, 8) = ComboBox5.Value
Cells(g, 9) = ComboBox6.Value
Cells(g, 15) = ComboBox7.Value
Cells(g, 16) = ComboBox8.Value
Cells(g, 17) = ComboBox9.Value
Cells(g, 25) = ComboBox10.Value
Cells(g, 45) = ComboBox11.Value
End If
End If
sort1
ActiveWorkbook.Save
End Sub
'HA
Private Sub ComboBox10_Change()
On Error Resume Next
TextBox17 = Format(Sheets("Ärzte").Cells(ComboBox10.ListIndex + 2, 6))
TextBox18 = Format(Sheets("Ärzte").Cells(ComboBox10.ListIndex + 2, 7))
TextBox21 = Format(Sheets("Ärzte").Cells(ComboBox10.ListIndex + 2, 3))
TextBox22 = Format(Sheets("Ärzte").Cells(ComboBox10.ListIndex + 2, 9))
TextBox23 = Format(Sheets("Ärzte").Cells(ComboBox10.ListIndex + 2, 8))
TextBox24 = Format(Sheets("Ärzte").Cells(ComboBox10.ListIndex + 2, 4))
TextBox25 = Format(Sheets("Ärzte").Cells(ComboBox10.ListIndex + 2, 5))
End Sub
'FA
Private Sub ComboBox9_Change()
On Error Resume Next
TextBox19 = Format(Sheets("Ärzte").Cells(ComboBox9.ListIndex + 2, 6))
TextBox20 = Format(Sheets("Ärzte").Cells(ComboBox9.ListIndex + 2, 7))
TextBox26 = Format(Sheets("Ärzte").Cells(ComboBox9.ListIndex + 2, 3))
TextBox27 = Format(Sheets("Ärzte").Cells(ComboBox9.ListIndex + 2, 9))
TextBox28 = Format(Sheets("Ärzte").Cells(ComboBox9.ListIndex + 2, 8))
TextBox29 = Format(Sheets("Ärzte").Cells(ComboBox9.ListIndex + 2, 4))
TextBox30 = Format(Sheets("Ärzte").Cells(ComboBox9.ListIndex + 2, 5))
End Sub
'KK
Private Sub ComboBox6_Change()
On Error Resume Next
TextBox31 = Format(Sheets("KK").Cells(ComboBox6.ListIndex + 2, 4))
TextBox32 = Format(Sheets("KK").Cells(ComboBox6.ListIndex + 2, 5))
TextBox33 = Format(Sheets("KK").Cells(ComboBox6.ListIndex + 2, 2))
TextBox34 = Format(Sheets("KK").Cells(ComboBox6.ListIndex + 2, 3))
TextBox35 = Format(Sheets("KK").Cells(ComboBox6.ListIndex + 2, 6))
End Sub
Gruß Holger