Ich habe ein Makro, das mir die Werte aus Spalten in eine txt-Datei kopieren soll.
Es sollen jedoch nur die Zeilen kopiert werden, die auch wirklich gefüllt sind.
Im Moment kopiert er auch leere Zeilen, die nur formatiert wurden.
Wer kann helfen?
Sub TextExport()
Dim i As Long, tmp As String
Open Range("B5") & ".txt" For Output As #1
For i = 5 To Range("G65536").End(xlUp).Row
tmp = ""
tmp = tmp & WorksheetFunction.Text(Cells(i, 3), "D/M/YYYY") & Chr(9)
tmp = tmp & WorksheetFunction.Substitute(format(Cells(i, 4),"0.00000"), ",", ".") & Chr(9)
tmp = tmp & WorksheetFunction.Substitute(format(Cells(i, 5),"0.00000"), ",", ".") & Chr(9)
tmp = tmp & WorksheetFunction.Substitute(format(Cells(i, 6),"0.00000"), ",", ".") & Chr(9)
tmp = tmp & WorksheetFunction.Substitute(format(Cells(i, 7),"0.00000"), ",", ".")
Print #1, tmp
Next i
Print #1, Chr(13)
Close 1
End Sub
Gruß,
Daniel