txt kayıtta nerde hata yapmışım

Katılım
9 Ocak 2008
Mesajlar
133
Excel Vers. ve Dili
office xp
Private Sub CommandButton1_Click()
yol = "C:\Documents and Settings\ak\Desktop" 'Dosyaların kaydedileceği yol
ChDir yol
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
With Sheets(i + 2)
Open yol & .Name & ".txt" For Output As #1
For x = 1 To .[a65536].End(3).Row
Print #1, .Cells(x, 1), .Cells(x, 2), .Cells(x, 3), .Cells(x, 4), .Cells(x, 5)
Next x
Close #1
End With
End If
Next i

End Sub
Private Sub UserForm_Initialize()
For i = 1 To Sheets.Count
If Sheets(i).Name <> "KAPAK" Then
ListBox1.AddItem Sheets(i).Name
End If
Next
End Sub



kaydetemedim hatam nerde
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
Aşağıdakini bir deneseniz.:cool:
Kod:
Private Sub CommandButton1_Click()
yol = "C:\Documents and Settings\ak\Desktop" 'Dosyaların kaydedileceği yol
ChDir yol
For i = 0 To ListBox1.ListCount - 1

With Sheets(i + 2)
Open yol & .Name & ".txt" For Output As #1
For x = 1 To .[a65536].End(3).Row
Print #1, .Cells(x, 1), .Cells(x, 2), .Cells(x, 3), .Cells(x, 4), .Cells(x, 5)
Next x
Close #1
End With
Next i

End Sub
 
Üst