DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
bir sayının yazıyla formülü yazıyorum hata veriyor örnek: a1 de 25 yazıyor b1 re =yazıyla(a1) diyorum hata veriyor
ekledim dosyayı
public Function YaziylaTL(cTutar As Currency) As String
Dim cLira As Currency, cKurus As Currency, sStr As String, bEksi As Boolean
If cTutar < 0 Then cTutar = -cTutar: bEksi = True
cTutar = Format(cTutar, "#,##0.00")
cLira = Int(cTutar)
cKurus = Left((cTutar - cLira) * 100, 2)
If cLira = 0 Then
sStr = ""
Else
sStr = Yaziyla(cLira) & " TL"
End If
If cKurus = 0 Then
sStr = sStr & ""
Else
sStr = sStr & IIf(sStr <> "", ", ", "") & Yaziyla(cKurus) & " KR"
End If
If sStr = "" Then sStr = "SIFIR"
If bEksi Then sStr = "eksi" & sStr
YaziylaTL = sStr
End Function
Private Function Yaziyla(cTutar As Currency)
Dim a, s, e As String
Dim pozitif, negatif As Boolean
Dim x As Byte
Dim b$(9)
Dim y$(9)
Dim m$(4)
Dim v(15)
Dim c(3)
b$(0) = ""
b$(1) = "BİR"
b$(2) = "İKİ"
b$(3) = "ÜÇ"
b$(4) = "DÖRT"
b$(5) = "BEŞ"
b$(6) = "ALTI"
b$(7) = "YEDİ"
b$(8) = "SEKİZ"
b$(9) = "DOKUZ"
y$(0) = ""
y$(1) = "ON"
y$(2) = "YİRMİ"
y$(3) = "OTUZ"
y$(4) = "KIRK"
y$(5) = "ELLİ"
y$(6) = "ALTMIŞ"
y$(7) = "YETMİŞ"
y$(8) = "SEKSEN"
y$(9) = "DOKSAN"
m$(0) = "TRİLYON"
m$(1) = "MİLYAR"
m$(2) = "MİLYON"
m$(3) = "BİN"
m$(4) = ""
a = Str(cTutar)
If Left$(a, 1) = " " Then pozitif = 1 Else pozitif = 0
a = Right$(a, Len(a) - 1)
For x = 1 To Len(a)
If (Asc(Mid$(a, x, 1)) > Asc("9")) Or (Asc(Mid$(a, x, 1)) < Asc("0")) Then GoTo hata
Next x
If Len(a) > 15 Then GoTo hata
a = String(15 - Len(a), "0") + a
For x = 1 To 15
v(x) = Val(Mid$(a, x, 1))
Next x
s = ""
For x = 0 To 4
c(1) = v((x * 3) + 1)
c(2) = v((x * 3) + 2)
c(3) = v((x * 3) + 3)
If c(1) = 0 Then
e = ""
ElseIf c(1) = 1 Then
e = "YÜZ"
Else
e = b$(c(1)) + "YÜZ"
End If
e = e + y$(c(2)) + b$(c(3))
If e <> "" Then e = e + m$(x)
If (x = 3) And (e = "BİRBİN") Then e = "BİN"
s = s + e
Next x
If s = "" Then s = "SIFIR"
If pozitif = 0 Then s = "eksi" + s
Yaziyla = s '+ " TL"
GoTo tamam
hata: Yaziyla = "HATA"
tamam:
End Function