wie muss ich den angehängten Code anpassen. Damit nur Beträge (positive Zahlen) kopiert werden.
Sprich, von "ws_con" in "ws_total"
Weiß leider nicht, wo und wie ich die "ABS-Funktion" integrieren soll.
Public Sub Kopieren ()
Dim wb_con As Workbook 'Quelle
Dim wb_total As Workbook 'Ziel
Dim ws_total As Worksheet 'Ziel
Dim ws_con As Worksheet 'Quelle
Dim strPeriode As String
On Error Resume Next
Set wb_total = Workbooks("xyz.xlsm")
On Error GoTo 1
If wb_total Is Nothing Then
Workbooks.Open "\\...."
End If
1
Set wb_con = ThisWorkbook
Set ws_total = Workbooks("xyz.xlsm").Worksheets("xx")
strPeriode = Workbooks("zyx.xlsm").Worksheets("xy").Range("AM2")
Application.ScreenUpdating = False
i = ws_total.Range("A10000").End(xlUp).Row + 1
For Each ws_con In wb_con.Worksheets
If ws_con.Range("DJ5") = "Datum" Then
If ws_con.Range("DJ6") "" Then
ws_total.Range("A" & i).Value = ws_con.Range("H4").Value
ws_total.Range("B" & i).Value = ws_con.Range("DJ5").Value
Else: GoTo 0
End If
End If
i = i + 1
0
Next
Application.ScreenUpdating = True
End Sub
Vielen Dank euch!