- Katılım
- 3 Mart 2009
- Mesajlar
- 519
- Excel Vers. ve Dili
- excel 2003 tr
Arkadaşlar aşadaki kod ile bir döngü kurmaya çalıştım fakat bir yerde hata yapıyorum örnek dosya ektedir...
Fonksiyon formülü
Sub AAAHES_AKTARIM()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
'Application.EnableEvents = False
Application.Volatile
Dim x1 As Integer
Dim x2 As Integer
For x1 = 2 To 9
For x2 = 4 To 24
If Sheets("DDD").Cells(x2, x1).Text = "" Then
a = Application.WorksheetFunction.Rept(". ", 0)
Else
a = Application.WorksheetFunction.Rept(" ", Sheets("DDD").Cells(3, x1).Value - Len(Sheets("DDD").Cells(x2, x1).Text) + 1)
End If
Sheets("DDD").Cells(x2 + 22, 2).Value = _
Sheets("DDD").Cells(x2, 2).Value & a & _
Sheets("DDD").Cells(x2, 3).Value & a & _
Sheets("DDD").Cells(x2, 4).Value & a & _
Sheets("DDD").Cells(x2, 5).Value & a & _
Sheets("DDD").Cells(x2, 6).Value & a & _
Sheets("DDD").Cells(x2, 7).Value & a & _
Sheets("DDD").Cells(x2, 8).Value & a & _
Sheets("DDD").Cells(x2, 9).Value & a
Next x2
Next x1
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
End Sub
Fonksiyon formülü
=B4&YİNELE(" ";EĞER(B4="";0;B$3-UZUNLUK(B4)+1))&C4&YİNELE(" ";EĞER(C4="";0;C$3-UZUNLUK(C4)+1))&D4&YİNELE(" ";EĞER(D4="";0;D$3-UZUNLUK(D4)+1))&E4&YİNELE(" ";EĞER(E4="";0;E$3-UZUNLUK(E4)+1))&F4&YİNELE(" ";EĞER(F4="";0;F$3-UZUNLUK(F4)+1))&G4&YİNELE(" ";EĞER(G4="";0;G$3-UZUNLUK(G4)+1))&H4&YİNELE(" ";EĞER(H4="";0;H$3-UZUNLUK(H4)+1))&I4
