Hallo
ich weiß, daß folgende VBA Routine nicht funktioniert, was mir der Debugger beim Kompilieren bestätigt, ich weiß aber nicht, wie das Problem gelöst wird.
With Sheets(2)
With Korrekturblatt
.TextBox1.Text = .Cells(Zeile, 1).Text
.TextBox2.Text = .Cells(Zeile, 2).Text
.TextBox3.Text = .Cells(Zeile, 4).Text
.TextBox4.Text = .Cells(Zeile, 3).Text
.TextBox5.Text = .Cells(Zeile, 5).Text
.TextBox6.Text = .Cells(Zeile, 6).Text
.TextBox7.Text = .Cells(Zeile, 7).Text
.TextBox8.Text = .Cells(Zeile, 9).Text
.TextBox9.Text = .Cells(Zeile, 8).Text
.TextBox10.Text = .Cells(Zeile, 10).Text
.TextBox11.Text = .Cells(Zeile, 11).Text
.TextBox12.Text = .Cells(Zeile, 12).Text
End With
End With
Korrekturblatt.Show
Ohne „with“ heißt es: "Korrekturblatt.TextBox1.Text = Sheets(2).Cells(Zeile, 1).Text
Ich weiß, wie das mit 1x with gemacht wird, würde aber gern wissen, ob es einen Trick gibt, dem „with“ klarzumachen, zu w e l c h e m Ausdruck es gehören soll bzw. das „with“ aufzuteilen.
Gruß
Pauli