mit folgender anweisung trage ich werte in zwei blocks in einer tabellenblatt ein.
'*** Werte eintragen ***
Private Sub CommandButton1_Click()
'Variablendeklaration
Dim ingRow As Long
Dim intRow As Long
'Wenn kein Datensatz ausgewählt wurd, Sub verlassen
If ComboBox1.ListIndex = -1 Then Exit Sub
'Werte in Zeile 23 bestimmen
ingRow = Cells(39, 1).End(xlUp).Row + 1
If ingRow < 23 Then ingRow = 23
'Artikel eintragen
Cells(ingRow, 1) = txtSpalte2.Value
'Einzelpreis eintragen
Cells(ingRow, 6) = ComboBox2.Value
'Menge eintragen
Cells(ingRow, 7) = txtSpalte3.Value
'Einheit eintragen
Cells(ingRow, 5) = Label17()
txtSpalte3 = ""
'*** Pfandabrechnung eintragen ***
'Werte in Zeile43 bestimmen
intRow = Cells(57, 1).End(xlUp).Row + 1
If intRow < 43 Then intRow = 43
'Artikel eintragen
Cells(intRow, 1) = txtSpalte5
'Einzelpreis eintragen
Cells(intRow, 4) = Label18()
'Bezug eintragen
Cells(intRow, 5) = txtSpalte7
'Rückgabe eintragen
Cells(intRow, 6) = txtSpalte8
txtSpalte4 = ""
txtSpalte7 = ""
txtSpalte8 = ""
Call UserForm_Initialize
End Sub
das klappt auch prima. es geht um den bereich ab
'*** pfandabrechnung eintragen ***
jetzt mein problem. wenn die txtspalte5 leer ist soll nur der erste bereich "ingrow=cells(39,1).end(xlup).row+1" eingetragen werden. ich hoffe ich habe das problem richtig beschrieben.
für eure hilfe wäre ich dankbar.
gruß martin