எக்சலில் எண்ணை தமிழ் எழுத்தாக மாற்ற கீழ் காணும் code சந்திபிழைகள் கொண்டதாக உள்ளது. coding அனுபவம் உள்ளவர்கள் உதவுங்கள்.
Function tamilno(amt As Variant) As Variant Dim FIGURE As Variant Dim LENFIG As Integer Dim i As Integer Dim WORDs(20) As String Dim tens(9) As String WORDs(1) = ChrW$(2962) & ChrW$(2985) & ChrW$(3021) & ChrW$(2993) & ChrW$(3009) & " " WORDs(2) = ChrW$(2951) & ChrW$(2992) & ChrW$(2979) & ChrW$(3021) & ChrW$(2975) & ChrW$(3009) & " " WORDs(3) = ChrW$(2990) & ChrW$(3010) & ChrW$(2985) & ChrW$(3021) & ChrW$(2993) & ChrW$(3009) & " " WORDs(4) = ChrW$(2984) & ChrW$(3006) & ChrW$(2985) & ChrW$(3021) & ChrW$(2965) & ChrW$(3009) & " " WORDs(5) = ChrW$(2960) & ChrW$(2984) & ChrW$(3021) & ChrW$(2980) & ChrW$(3009) WORDs(6) = ChrW$(2950) & ChrW$(2993) & ChrW$(3009) & " " WORDs(7) = ChrW$(2959) & ChrW$(2996) & ChrW$(3009) & " " WORDs(8) = ChrW$(2958) & ChrW$(2975) & ChrW$(3021) & ChrW$(2975) & ChrW$(3009) & " " WORDs(9) = ChrW$(2962) & ChrW$(2985) & ChrW$(3021) & ChrW$(2986) & ChrW$(2980) & ChrW$(3009) & " " WORDs(10) = ChrW$(2986) & ChrW$(2980) & ChrW$(3021) & ChrW$(2980) & ChrW$(3009) & " " WORDs(11) = ChrW$(2986) & ChrW$(2980) & ChrW$(3007) & ChrW$(2985) & ChrW$(3018) & ChrW$(2985) & ChrW$(3021) & ChrW$(2993) & ChrW$(3009) & " " WORDs(12) = ChrW$(2986) & ChrW$(2985) & ChrW$(3021) & ChrW$(2985) & ChrW$(3007) & ChrW$(2992) & ChrW$(2979) & ChrW$(3021) & ChrW$(2975) & ChrW$(3009) & " " WORDs(13) = ChrW$(2986) & ChrW$(2980) & ChrW$(3007) & ChrW$(2985) & ChrW$(3021) & ChrW$(2990) & ChrW$(3010) & ChrW$(2985) & ChrW$(3021) & ChrW$(2993) & ChrW$(3009) & " " WORDs(14) = ChrW$(2986) & ChrW$(2980) & ChrW$(3007) & ChrW$(2985) & ChrW$(3006) & ChrW$(2985) & ChrW$(3021) & ChrW$(2965) & ChrW$(3009) & " " WORDs(15) = ChrW$(2986) & ChrW$(2980) & ChrW$(3007) & ChrW$(2985) & ChrW$(3016) & ChrW$(2984) & ChrW$(3021) & ChrW$(2980) & ChrW$(3009) & " " WORDs(16) = ChrW$(2986) & ChrW$(2980) & ChrW$(3007) & ChrW$(2985) & ChrW$(3006) & ChrW$(2993) & ChrW$(3009) & " " WORDs(17) = ChrW$(2986) & ChrW$(2980) & ChrW$(3007) & ChrW$(2985) & ChrW$(3015) & ChrW$(2996) & ChrW$(3009) & " " WORDs(18) = ChrW$(2986) & ChrW$(2980) & ChrW$(3007) & ChrW$(2985) & ChrW$(3014) & ChrW$(2975) & ChrW$(3021) & ChrW$(2975) & ChrW$(3009) & " " WORDs(19) = ChrW$(2986) & ChrW$(2980) & ChrW$(3021) & ChrW$(2980) & ChrW$(3014) & ChrW$(3006) & ChrW$(2985) & ChrW$(3021) & ChrW$(2986) & ChrW$(2980) & ChrW$(3009) & " " 'WORDs(20) = ChrW$(2951) & ChrW$(2992) & ChrW$(3009) & ChrW$(2986) & ChrW$(2980) & ChrW$(3009) & " " tens(2) = ChrW$(2951) & ChrW$(2992) & ChrW$(3009) & ChrW$(2986) & ChrW$(2980) & ChrW$(3009) & " " '& ChrW$(2980) & ChrW$(3009) & " " tens(3) = ChrW$(2990) & ChrW$(3009) & ChrW$(2986) & ChrW$(3021) & ChrW$(2986) & ChrW$(2980) & ChrW$(3009) & " " tens(4) = ChrW$(2984) & ChrW$(3006) & ChrW$(2993) & ChrW$(3021) & ChrW$(2986) & ChrW$(2980) & ChrW$(3009) & " " tens(5) = ChrW$(2960) & ChrW$(2990) & ChrW$(3021) & ChrW$(2986) & ChrW$(2980) & ChrW$(3009) & " " tens(6) = ChrW$(2949) & ChrW$(2993) & ChrW$(3009) & ChrW$(2986) & ChrW$(2980) & ChrW$(3009) & " " tens(7) = ChrW$(2958) & ChrW$(2996) & ChrW$(3009) & ChrW$(2986) & ChrW$(2980) & ChrW$(3009) & " " tens(8) = ChrW$(2958) & ChrW$(2979) & ChrW$(3021) & ChrW$(2986) & ChrW$(2980) & ChrW$(3009) & " " tens(9) = ChrW$(2980) & ChrW$(3014) & ChrW$(3006) & ChrW$(2985) & ChrW$(3021) & ChrW$(2985) & ChrW$(3010) & ChrW$(2993) & ChrW$(3009) & " " FIGURE = amt FIGURE = Format(FIGURE, "FIXED") FIGLEN = Len(FIGURE) If FIGLEN < 12 Then FIGURE = Space(12 - FIGLEN) & FIGURE End If If Val(Left(FIGURE, 9)) > 1 Then tamilno = ChrW$(2992) & ChrW$(3010) & ChrW$(2986) & ChrW$(3006) & ChrW$(2991) & ChrW$(3021) & " " 'Rupees ElseIf Val(Left(FIGURE, 9)) = 1 Then tamilno = ChrW$(2992) & ChrW$(3010) & ChrW$(2986) & ChrW$(3006) & ChrW$(2991) & ChrW$(3021) & " " End If For i = 1 To 3 If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then tamilno = tamilno & WORDs(Val(Left(FIGURE, 2))) ElseIf Val(Left(FIGURE, 2)) > 19 Then tamilno = tamilno & tens(Val(Left(FIGURE, 1))) tamilno = tamilno & WORDs(Val(Right(Left(FIGURE, 2), 1))) End If If i = 1 And Val(Left(FIGURE, 2)) > 0 Then tamilno = tamilno & ChrW$(2965) & ChrW$(3019) & ChrW$(2975) & ChrW$(3007) 'Crore ElseIf i = 2 And Val(Left(FIGURE, 2)) > 0 Then tamilno = tamilno & ChrW$(2951) & ChrW$(2994) & ChrW$(2975) & ChrW$(3021) & ChrW$(2970) & ChrW$(2990) & ChrW$(3021) & " " 'Lakh ElseIf i = 3 And Val(Left(FIGURE, 2)) > 0 Then tamilno = tamilno & ChrW$(2950) & ChrW$(2991) & ChrW$(3007) & ChrW$(2992) & ChrW$(2990) & ChrW$(3021) & " " 'Thousand End If FIGURE = Mid(FIGURE, 3) Next i If Val(Left(FIGURE, 1)) > 0 Then tamilno = tamilno & WORDs(Val(Left(FIGURE, 1))) + ChrW$(2984) & ChrW$(3010) & ChrW$(2993) & ChrW$(3009) & " " 'Hundred End If FIGURE = Mid(FIGURE, 2) If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then tamilno = tamilno & WORDs(Val(Left(FIGURE, 2))) ElseIf Val(Left(FIGURE, 2)) > 19 Then tamilno = tamilno & tens(Val(Left(FIGURE, 1))) tamilno = tamilno & WORDs(Val(Right(Left(FIGURE, 2), 1))) End If FIGURE = Mid(FIGURE, 4) If Val(FIGURE) > 0 Then tamilno = tamilno & ChrW$(2965) & ChrW$(3006) & ChrW$(2970) & ChrW$(3009) & " " '& ChrW$(2965) & ChrW$(2995) & ChrW$(3021) & " " 'paisa If Val(Right(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then tamilno = tamilno & WORDs(Val(Left(FIGURE, 2))) ElseIf Val(Left(FIGURE, 2)) > 19 Then tamilno = tamilno & tens(Val(Left(FIGURE, 1))) tamilno = tamilno & WORDs(Val(Right(Left(FIGURE, 2), 1))) End If End If FIGURE = amt FIGURE = Format(FIGURE, "FIXED") If Val(FIGURE) > 0 Then tamilno = tamilno & " " & ChrW$(2990) & ChrW$(2975) & ChrW$(3021) & ChrW$(2975) & ChrW$(3009) & ChrW$(2990) & ChrW$(3021) 'Only End If End Function குறிப்பு |
||||||
vba editor-ல் நேரடியாக தமிழை எழுத இயலாது. எனவே ChrW$(2962)-என்று ஒவ்வொரு keyக்கும் தமிழுக்கான Unicode value கொடுத்து excel -ல் தெரியவைக்கலாம். | ||||||
2 comments:
அருமை
அருமையான பதிவு
Post a Comment