Gruppe
Allgemein
Problem
Wie kann ich eine geschriebene Rechnung in ein Journal eintragen und das Rechnungslbatt für eine neue Rechnung initialisieren?
StandardModule: basMain
Sub NeueRechnung()
Dim wksJournal As Worksheet
Dim iRowT As Integer, iRowS As Integer, iCounter As Integer
Set wksJournal = Worksheets("Journal")
With Worksheets("Journal")
iRowT = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
iRowS = 28
For iCounter = 6 To 8
.Cells(iRowT, iCounter) = Cells(46, iCounter)
Next iCounter
Do Until IsEmpty(Cells(iRowS, 1))
.Cells(iRowT, 1) = Range("H19")
.Cells(iRowT, 2) = Range("H21")
.Cells(iRowT, 3) = Range("H20")
.Cells(iRowT, 4) = Cells(iRowS, 1)
.Cells(iRowT, 5) = Cells(iRowS, 4)
iRowS = iRowS + 1
iRowT = iRowT + 1
Loop
End With
ActiveSheet.Copy
ThisWorkbook.Activate
Range("A8:A13, H20,A28:H45").ClearContents
Range("H19") = Range("H19") + 1
Range("H21") = Date
End Sub