DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Sub txt()
Dim Dosya, Veri
Dim deg(10)
Dosya = ThisWorkbook.Path & "\yazi.txt"
Open Dosya For Output As #1
For i = 1 To Cells(Rows.Count, "H").End(3).Row
If i = 1 Then
ElseIf i = 2 Then
deg(1) = RightPadChar(Format(Cells(i, "B").Value, "##,##"), " ", 3) & " Mevcut : "
deg(2) = RightPadChar(Format(Cells(i, "C").Value, "##,##"), " ", 3) & " Mevcut : "
deg(3) = RightPadChar(Format(Cells(i, "D").Value, "##,##"), " ", 3) & " Mevcut : "
deg(4) = RightPadChar(Format(Cells(i, "E").Value, "##,##"), " ", 3) & " Mevcut : "
deg(5) = RightPadChar(Format(Cells(i, "F").Value, "##,##"), " ", 3) & " Mevcut : "
deg(6) = RightPadChar(Format(Cells(i, "G").Value, "##,##"), " ", 3) & " Mevcut : "
deg(7) = RightPadChar(Format(Cells(i, "H").Value, "##,##"), " ", 3) & " Mevcut : "
ElseIf i = 3 Then
deg(1) = deg(1) & RightPadChar(Format(Cells(i, "B").Value, "##,##"), " ", 2) & " İhtiyaç : "
deg(2) = deg(2) & RightPadChar(Format(Cells(i, "C").Value, "##,##"), " ", 2) & " İhtiyaç : "
deg(3) = deg(3) & RightPadChar(Format(Cells(i, "D").Value, "##,##"), " ", 2) & " İhtiyaç : "
deg(4) = deg(4) & RightPadChar(Format(Cells(i, "E").Value, "##,##"), " ", 2) & " İhtiyaç : "
deg(5) = deg(5) & RightPadChar(Format(Cells(i, "F").Value, "##,##"), " ", 2) & " İhtiyaç : "
deg(6) = deg(6) & RightPadChar(Format(Cells(i, "G").Value, "##,##"), " ", 2) & " İhtiyaç : "
deg(7) = deg(7) & RightPadChar(Format(Cells(i, "H").Value, "##,##"), " ", 2) & " İhtiyaç : "
ElseIf i = 4 Then
deg(1) = deg(1) & RightPadChar(Format(Cells(i, "B").Value, "##,##"), " ", 3) & Cells(6, "a").Value & ": "
deg(2) = deg(2) & RightPadChar(Format(Cells(i, "C").Value, "##,##"), " ", 3) & Cells(7, "a").Value & ": "
deg(3) = deg(3) & RightPadChar(Format(Cells(i, "D").Value, "##,##"), " ", 3) & Cells(8, "a").Value & ": "
deg(4) = deg(4) & RightPadChar(Format(Cells(i, "E").Value, "##,##"), " ", 3) & Cells(9, "a").Value & ": "
deg(5) = deg(5) & RightPadChar(Format(Cells(i, "F").Value, "##,##"), " ", 3) & Cells(10, "a").Value & ": "
deg(6) = deg(6) & RightPadChar(Format(Cells(i, "G").Value, "##,##"), " ", 3) & Cells(11, "a").Value & ": "
deg(7) = deg(7) & RightPadChar(Format(Cells(i, "H").Value, "##,##"), " ", 3) & Cells(12, "a").Value & ": "
ElseIf i = 5 Then
Else
k = k + 1
For j = 2 To 8
If Cells(i, j).Value <> "" Then
deg(k) = deg(k) & RightPadChar(Cells(i, j).Value, " ", 8) & "ton "
End If
Next
End If
Next
Print #1, "42DE Glikoz Kapasitesi : " & deg(1)
Print #1,
Print #1, "60DE Glikoz Kapasitesi : " & deg(2)
Print #1,
Print #1, "Bisküvilik Yağ Kapasitesi: " & deg(3)
Print #1,
Print #1, "Kek Yağı Kapasitesi : " & deg(4)
Print #1,
Print #1, "Sıvı Şeker Kapasitesi : " & deg(5)
Print #1,
Print #1, "Trio 41 Kapasitesi : " & deg(6)
Print #1,
Print #1, "Ayçiçek Yağı Kapasitesi : " & deg(7)
Print #1,
Print #1,
Print #1, "."
Print #1,
Print #1, "."
Print #1,
Print #1,
Print #1, "."
Print #1, "MN"
Print #1, "ÜA"
Print #1,
Close #1
'Sheets("tablo").Select
End Sub
Function RightPadChar(ByVal Astr As String, PadChar As String, stLen As Integer) As String
Dim AStrL As Integer
Astr = Trim(Astr)
AStrL = Len(Astr)
If AStrL < stLen Then
Astr = Astr + String(stLen - AStrL, PadChar)
Else
Astr = Mid$(Astr, 1, stLen)
End If
RightPadChar = Astr
End Function
Function LeftPadChar(ByVal Astr As String, PadChar As String, stLen As Integer) As String
Dim AStrL As Integer
Astr = Trim(Astr)
AStrL = Len(Astr)
If AStrL < stLen Then
Astr = String(stLen - AStrL, PadChar) + Astr
Else
Astr = Mid$(Astr, 1, stLen)
End If
LeftPadChar = Astr
End Function
Kod:RightPadChar(Format(Cells(i, "G").Value, "##,##"), " ", 3)
Yukarıdaki gibi kod bloğuna ait bir satırım var ama ne yaparsam yapayım, Ondalık olarak çıktı alamıyorum?