excel dosyasını txt formatında kayıt

Katılım
23 Kasım 2007
Mesajlar
12
Excel Vers. ve Dili
2007
yüklemiş olduğum excel dosyasını her hücrenin arasında|işaret olup txt formatında kaydetmeme yardımcı olabilir misiniz
 

Ekli dosyalar

Merhaba,

Aşağıdaki kodu dener misiniz?

C:\Deneme.txt dosyası oluşturur.

Kod:
Sub MetinDosyasiYap()
    Dim i   As Long
    Dim j   As Integer
    Dim k   As Integer
    Dim fs  As Object
    Dim a   As Object
    Dim Sat As String
    
    j = [IV1].End(1).Column
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set a = fs.CreateTextFile("c:\Deneme.txt", True)
    
    For i = 1 To [A65536].End(3).Row
        Sat = ""
        For k = 1 To j
            If k <> j Then
                Sat = Sat & Cells(i, k) & "|"
            Else
                Sat = Sat & Cells(i, k)
            End If
        Next k
        
        a.WriteLine (Sat)
    Next i
a.Close
MsgBox "c:\Deneme.txt Dosyasına Yazdırılmıştır...."
End Sub
 
Geri
Üst