Live-Forum - Die aktuellen Beiträge
Datum
Titel
29.03.2024 13:14:12
28.03.2024 21:12:36
28.03.2024 18:31:49
Anzeige
Archiv - Navigation
816to820
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
816to820
816to820
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Eingabemaske Datumsproblem

Eingabemaske Datumsproblem
14.11.2006 17:42:42
Eingabemske
Hallo Leute,
vielleicht kann mir jemand Helfen, ich sitze seit 3 Tage fest und komme nicht weiter.
Habe eine eigene Eingabemaske, sie besteht aus 7 Eingabefelders. Das erste „Eingabefeld“ ist ein Dropdownfeld und übernimmt das Datum aus der festgelegten Datumsspalte „A2 bis A366“. Im 2 Feld, wird das ausgewählte Datum übernommen, in den restlichen Feldern werden die eigentliche Werte eingegeben. Die Eingabe funktioniert problemlos, aber beim abspeichern werden die eingegebenen Werte nicht in die Zeile die dem Datum zugewiesen worden sind, sondern am Ende des Tabellenblatts angefügt, außerdem wir das Datum in Normalen Textformat konvertiert.
Habe den Code mal angegeben, vielleicht schafft es einer den Fehler zu finden und ev. korrigieren,
ich wäre sehr dankbar dafür
Gruß Achi
Option Explicit

Private Sub ComboBox1_Click()
If ComboBox1.ListIndex <> 0 Then
TextBox1 = Cells(ComboBox1.ListIndex + 1, 1)
TextBox2 = Cells(ComboBox1.ListIndex + 1, 2)
TextBox3 = Cells(ComboBox1.ListIndex + 1, 3)
TextBox4 = Cells(ComboBox1.ListIndex + 1, 4)
TextBox5 = Cells(ComboBox1.ListIndex + 1, 5)
Else
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
End If
End Sub


Private Sub CommandButton1_Click()
If ComboBox1.ListIndex > 0 Then
Rows(ComboBox1.ListIndex + 1).Delete
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
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 = [A65536].End(xlUp).Row + 1
Else
xZeile = ComboBox1.ListIndex + 1
End If
Cells(xZeile, 1) = TextBox1
Cells(xZeile, 2) = TextBox2
Cells(xZeile, 3) = TextBox3
Cells(xZeile, 4) = TextBox4
Cells(xZeile, 5) = TextBox5
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
Columns("B:F").Sort Key1:=Range("B3"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
UserForm_Initialize
End Sub


Private Sub CommandButton3_Click()
Unload Me
End Sub


Private Sub TextBox5_Change()
End Sub


Private Sub UserForm_Initialize()
Dim aRow, i As Long
Application.EnableEvents = False
ComboBox1.Clear
aRow = [A65536].End(xlUp).Row
ComboBox1.AddItem "neue Person hinzufügen"
For i = 2 To aRow
ComboBox1.AddItem Cells(i, 1) & ", " & Cells(i, 2)
Next i
ComboBox1.ListIndex = 0
Application.EnableEvents = True
End Sub

6
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
doppelt o.w.T.
14.11.2006 19:37:53
Reinhard

Gruß Reinhard ps: Ich freue mich über eine Rückmeldung ob diese Antwort hilfreich war oder nicht..
AW: doppelt o.w.T.
14.11.2006 20:34:03
Achi
Sory,
ich bin aber absoluter Laie, was meinst du mit AW: doppelt o.w.T. ?
AW: doppelt o.w.T.
14.11.2006 20:42:15
Reinhard
Hi Achi,
dieser Beitrag wurde doppelt hier eingestellt, deshalb steht er auch doppelt in "Offene Fragen", um ihn da nur einmal zu haben habe ich ihn hier beanteortet .
o.w.T= ohne weiteren Text, also es steht im Beitrag nichts lesenwertes drin.

Gruß Reinhard ps: Ich freue mich über eine Rückmeldung ob diese Antwort hilfreich war oder nicht..
Anzeige
AW: doppelt o.w.T.
14.11.2006 20:49:04
Achi
Net von dir, dass du so schnell geantwortet hast,
entschuldige meine Dämlichkeit, wo soll ich das eintragen?
AW: doppelt o.w.T.
14.11.2006 20:54:31
Reinhard
Hi Achi,
was sollst du eintragen? kann da grad nicht folgen
Gruß
Reinhard
AW: doppelt o.w.T.
15.11.2006 17:17:11
Achille
Hallo Leute,
helft mir bitte,
habe eine Eingabemaske.
Die Datumseingabe erfolgt über eine Combobox, die weiteren Dateneingaben erfolgen
durch manuelle Eingabe in die Textbox.
Nach übernahmen der Einträge erscheinen die Daten korrekt in die vorgesehenen Spalten.
Problem ist: Die Datumsformate sind Gelöscht und sind nur als numerische Zahlen erkennbar.
Meine Frage an die Profis „wo liegt bitte der Fehler“
Danke im Voraus Gruß Achi
****************************************************************************************
Option Explicit

Private Sub ComboBox1_Click()
If ComboBox1.ListIndex <> 0 Then
TextBox1 = Cells(ComboBox1.ListIndex + 1, 1)
TextBox2 = Cells(ComboBox1.ListIndex + 1, 2)
TextBox3 = Cells(ComboBox1.ListIndex + 1, 3)
TextBox4 = Cells(ComboBox1.ListIndex + 1, 4)
TextBox5 = Cells(ComboBox1.ListIndex + 1, 5)
Else
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
End If
End Sub


Private Sub CommandButton1_Click()
If ComboBox1.ListIndex > 0 Then
Rows(ComboBox1.ListIndex + 1).Delete
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
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 = [A65536].End(xlUp).Row + 1
Else
xZeile = ComboBox1.ListIndex + 1
End If
Cells(xZeile, 1) = TextBox1
Cells(xZeile, 2) = TextBox2
Cells(xZeile, 3) = TextBox3
Cells(xZeile, 4) = TextBox4
Cells(xZeile, 5) = TextBox5
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
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 = [A65536].End(xlUp).Row
ComboBox1.AddItem "  "
For i = 2 To aRow
ComboBox1.AddItem Cells(i, 1) & ", " & Cells(i, 2)
Next i
ComboBox1.ListIndex = 0
Application.EnableEvents = True
End Sub

Anzeige

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige