ich habe ein Problem beim Schreiben in eine Text-Datei. Dazu nutze ich folgenden Code:
Public Sub Rel_Datei_erzeugen()
Dateiname = "H:\1_Projekte_Aktiv\Rel01.txt"
For i = 15 To 21
strin "[Ne_Id] IS EQUAL " & """" & ActiveWorkbook.ActiveSheet.Cells(i, 2).Value & """" & " _
OR"
Next
strin = Left(strin, Len(strin) - 3)
Open "H:\1_Projekte_Aktiv\" & Dateiname For Output Access Write As #1
Write #1, strin
Close #1
End Sub
Ergebnis sollte sein:[Ne Id (C)] IS EQUAL "BB4310002691" OR
[Ne Id (C)] IS EQUAL "BB4314000004" OR
[Ne Id (C)] IS EQUAL "BB4310002686" OR
[Ne Id (C)] IS EQUAL "BB4310002702" OR
[Ne Id (C)] IS EQUAL "BB4310002807" OR
[Ne Id (C)] IS EQUAL "BB4310003713"
Stattdessen steht folgendes in der erzeugten Textdatei:
"[Ne Id (C)] IS EQUAL ""BB4310002691"" OR
[Ne Id (C)] IS EQUAL ""BB4314000004"" OR
[Ne Id (C)] IS EQUAL ""BB4310002686"" OR
[Ne Id (C)] IS EQUAL ""BB4310002702"" OR
[Ne Id (C)] IS EQUAL ""BB4310002807"" OR
[Ne Id (C)] IS EQUAL ""BB4310003713"""
Bin für jeden Hinweis dankbak.
Viele Grüße,
M. Born