Textbox
05.11.2008 12:31:00
Udo
ich habe diesen Code im Forum gefunden
ich versuche eine zusätzliche Textbox für Spalte E einzurichten
aber ich bekomme es einfach nicht hin.
Könnte mir bitte jemand weiterhelfen
Private Sub CommandButton1_Click()
Dim colMax(1 To 3) As Long
Dim i As Byte
Dim writeLine As Long
If Me.ComboBox1.ListIndex > -1 Then
With ThisWorkbook.Sheets(Me.ComboBox1.Value)
If IsEmpty(.Cells(Rows.Count, 1)) And IsEmpty(.Cells(Rows.Count, 2)) And IsEmpty(. _
_
Cells(Rows.Count, 3)) Then
For i = 1 To 3
colMax(i) = .Cells(Rows.Count, i).End(xlUp).Row
Next
writeLine = Application.Max(colMax) + 1
For i = 1 To 3
.Cells(writeLine, i).Value = Me.Controls("TextBox" & i).Value
Next
.Cells(Rows.Count, 3).End(xlUp).Offset(0, 1).Value = TextBox4.Value
Else
MsgBox "Es ist keine Zelle mehr frei"
End If
End With
Else
MsgBox ("Bitte Tabelle auswählen")
End If
End Sub
Viele Grüße
Udo