online 1
gast (50)

/ Forum / Tabellenkalkulation

TabellenkalkulationTabellenkalkulation

Fragevon Meikel vom 09.06.2019, 22:21 Options

Dateneingabe per Userfrom - Thread Closed

Hallo zusammen,

sorry, ich bin's schon wieder. Ich hoffe ich nerve nicht. Aber ich kommnicht weiter. Gebe meine Daten in eine Userform ein. Klappt auch soweit alles.
Der Datenbereich findet in den Spalten J:M statt und ab Zeile J32.
Die Daten werden auch soweit richtig hingeschrieben, allerdings
beginnend in J2.

Hier nun der Code:

Option Explicit

Private Sub ComboBox1_Click()
If ComboBox1.ListIndex <> 0 Then
TextBox1 = Cells(ComboBox1.ListIndex + 1, 10)
TextBox2 = Cells(ComboBox1.ListIndex + 1, 11)
TextBox4 = Cells(ComboBox1.ListIndex + 1, 12)
Else
TextBox1 = ""
TextBox2 = ""
TextBox4 = ""
End If
End Sub

Private Sub CommandButton1_Click()
If ComboBox1.ListIndex > 0 Then
Rows(ComboBox1.ListIndex + 1).Delete
TextBox1 = ""
TextBox2 = ""
TextBox4 = ""
UserForm_Initialize
End If
End Sub

Private Sub CommandButton2_Click()
Dim xZeile As Long
If TextBox1 = "" Then Exit Sub
If ComboBox1.ListIndex = 0 Then
xZeile = [J65536].End(xlUp).Row + 1
Else
xZeile = ComboBox1.ListIndex + 1
End If
Cells(xZeile, 10) = TextBox1
Cells(xZeile, 11) = TextBox2
Cells(xZeile, 12) = TextBox4
TextBox1 = ""
TextBox2 = ""
TextBox4 = ""
Columns("J:L").Sort Key1:=Range("J32"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=10, MatchCase:=False, Orientation:=xlTopToBottom
UserForm_Initialize
End Sub

Private Sub CommandButton3_Click()
Unload Me
End Sub


Private Sub UserForm_Initialize()
Dim aRow, i As Long
Application.EnableEvents = False
ComboBox1.Clear
aRow = [J65536].End(xlUp).Row
ComboBox1.AddItem "add new Contactperson"
For i = 2 To aRow
ComboBox1.AddItem Cells(i, 1) & ", " & Cells(i, 2)
Next i
ComboBox1.ListIndex = 0
Application.EnableEvents = True
End Sub

Könnte nochmal jemand helfen. Vielen herzlichen Dank vorab, Gruß meikel



  • *Threadedit*
    Admininfo: Führ bitte einen Thread nicht fort indem du Weitere eröffnest, und vermeide Mehrfachanfragen. Die Datenbank und User werden es dir danken. Siehe FAQ 2.


  • Antwort schreiben

    Ähnliche Themen

    xp installation - Thread Closed
    Oli07  18.05.2007 - 117 Hits -

    Grafikkartenproblem unter xp - Thread Closed
    Battleblubo  20.05.2007 - 113 Hits -

    Makro umschreiben - Thread Closed
    inselgerd  22.05.2007 - 109 Hits -

    PC-Cleaner - *Thread Closed*
    Kiwano  10.06.2007 - 102 Hits - 4 Antworten

    start cd - Thread Closed
    tyson  12.06.2007 - 96 Hits - 1 Antwort

    Hinweis

    Diese Frage ist schon etwas älter, Sie können daher nicht mehr auf sie antworten. Sollte Ihre Frage noch nicht gelöst sein, stellen Sie einfach eine neue Frage im Forum..

    Neue Einträge

    Version: supportware 1.9.150 / 10.06.2022, Startzeit:Thu Jan 8 21:07:44 2026