Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

An Beni wg. Daten zurückschreiben

Forumthread: An Beni wg. Daten zurückschreiben

An Beni wg. Daten zurückschreiben
10.03.2004 15:14:07
Stefane
Hallo Beni,
danke erstmal für Deine Beispiel-Datei. Dort funktioniert das auch! Leider nur in meiner Datei nicht. Es gibt ne Fehlermeldung: FEHLER BEIM KOMPILIEREN: Variable nicht definiert:
Gemeint ist damit die Zeile (If Zeile = "" Then Exit Sub). Hier, so sieht mein Code aus!
Gruß Stefan

Option Explicit

Private Sub cmdZurück_Click()
Unload Me
usreingabefeld.Show
End Sub


Private Sub UserForm_Initialize()
Worksheets("Anlagenklassen").Activate
Me.cboAnlagenklasse.RowSource = ("A2:B79")
Me.cboAnlagenklasse.ListIndex = "0"
Me.cboAnlagensachgruppe.RowSource = ("I2:J35")
Me.cboAnlagensachgruppe.ListIndex = "0"
Worksheets("Produkte").Activate
Me.cboProdukt.RowSource = ("A2:B31")
Me.cboProdukt.ListIndex = "0"
Me.cboAfaMethode.RowSource = ("H2:I6")
Me.cboAfaMethode.ListIndex = "0"
Me.cboGesperrt.RowSource = ("K2:K4")
Me.cboGesperrt.ListIndex = "0"
Worksheets("Kostenstellen").Activate
Me.cboKostenstelle.RowSource = ("A2:B393")
Me.cboKostenstelle.ListIndex = "0"
Worksheets("Gebäude").Activate
'Listenfeld einrichten
Dim r As Variant
ListBox1.ColumnCount = 31
r = Cells(65536, 2).End(xlUp).Row
ListBox1.RowSource = "A2:AE" & r
End Sub



Private Sub cmdDatenÄndern_Click()
' Aendern
If Zeile = "" Then Exit Sub
Cells(Zeile, 1) = txtlaufendeNummer.Value
Cells(Zeile, 2) = txtAnlagennummer.Value
Cells(Zeile, 3) = txtBeschreibung1.Value
Cells(Zeile, 4) = txtBeschreibung2.Value
Cells(Zeile, 5) = txtStandort.Value
Cells(Zeile, 6) = cboAnlagenklasse.Value
Cells(Zeile, 7) = cboAnlagensachgruppe.Value
Cells(Zeile, 8) = txtAnlagenbuchungsgruppe.Value
End Sub


Private Sub ListBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
On Error GoTo 1
ListBox1.SetFocus
'tpk = 1
ListBox1.BoundColumn = 1
txtlaufendeNummer.Value = ListBox1.Value
ListBox1.BoundColumn = 2
txtAnlagennummer.Value = ListBox1.Value
ListBox1.BoundColumn = 5
txtStandort.Value = ListBox1.Value
ListBox1.BoundColumn = 3
txtBeschreibung1.Value = ListBox1.Value
ListBox1.BoundColumn = 4
txtBeschreibung2.Value = ListBox1.Value
ListBox1.BoundColumn = 6
cboAnlagenklasse.Value = ListBox1.Value
ListBox1.BoundColumn = 7
cboAnlagensachgruppe.Value = ListBox1.Value
ListBox1.BoundColumn = 9
cboKostenstelle.Value = ListBox1.Value
ListBox1.BoundColumn = 10
cboProdukt.Value = ListBox1.Value
ListBox1.BoundColumn = 13
txtSeriennummer.Value = ListBox1.Value
ListBox1.BoundColumn = 12
txtLieferantennummer.Value = ListBox1.Value
ListBox1.BoundColumn = 19
txtAnschaffungsjahr.Value = ListBox1.Value
txtAnschaffungsjahr2.Value = ListBox1.Value
ListBox1.BoundColumn = 8
txtAnlagenbuchungsgruppe.Value = ListBox1.Value
ListBox1.BoundColumn = 24
txtAnschaffungskosten.Value = ListBox1.Value
txtAnschaffungskosten2.Value = ListBox1.Value
ListBox1.BoundColumn = 16
txtStartdatumAfa.Value = ListBox1.Value
ListBox1.BoundColumn = 15
cboAfaMethode.Value = ListBox1.Value
ListBox1.BoundColumn = 17
txtAbschreibung.Value = ListBox1.Value
ListBox1.BoundColumn = 14
cboGesperrt.Value = ListBox1.Value
ListBox1.BoundColumn = 20
txtBelegdatum.Value = ListBox1.Value
ListBox1.BoundColumn = 21
txtBelegnummer.Value = ListBox1.Value
ListBox1.BoundColumn = 22
txtexterneBelegnummer.Value = ListBox1.Value
ListBox1.BoundColumn = 23
txtBeschreibung3.Value = ListBox1.Value
ListBox1.BoundColumn = 26
txtAnlagedatum.Value = ListBox1.Value
ListBox1.BoundColumn = 27
txtBelegdatum2.Value = ListBox1.Value
ListBox1.BoundColumn = 28
txtBelegnummer2.Value = ListBox1.Value
ListBox1.BoundColumn = 29
txtexterneBelegnummer2.Value = ListBox1.Value
ListBox1.BoundColumn = 30
txtBeschreibung4.Value = ListBox1.Value
ListBox1.BoundColumn = 31
txtjährlicherAbschreibungsbetrag.Value = ListBox1.Value
1:
End Sub

Anzeige

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: An Beni wg. Daten zurückschreiben
10.03.2004 16:02:16
Beni
Hallo Stefan,
hast Du eine TextBox mit dem Name "Zeile",
mit Zeile = ListBox1.ListIndex + 1 wird die entsprechede Zeile ermittelt.
Gruss Beni
Anzeige
;

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Entdecke mehr
Finde genau, was du suchst

Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden

Suche nach den besten Antworten
Unsere beliebtesten Threads

Entdecke unsere meistgeklickten Beiträge in der Google Suche

Top 100 Threads jetzt ansehen
Anzeige