Dear all, How to convert English numbers to Bangla numbers by excel macro/formula
I have Input value in CELL A1 like below:
CELL A1: 1 2 3 4 5 6 7 8 9 0
I want to get the output like below:
CELL B1: ১ ২ ৩ ৪ ৫ ৬ ৭ ৮ ৯ ০
Dear all, How to convert English numbers to Bangla numbers by excel macro/formula
I have Input value in CELL A1 like below:
CELL A1: 1 2 3 4 5 6 7 8 9 0
I want to get the output like below:
CELL B1: ১ ২ ৩ ৪ ৫ ৬ ৭ ৮ ৯ ০
As a beginner starter :
PHP Code:
Sub Demo1()
Dim S$, C&, A&, B$
S = [A1].Text
For C = 1 To Len(S)
A = AscW(Mid(S, C))
Select Case A
Case 48 To 57: B = B & ChrW(2486 + A)
Case Else: B = B & ChrW(A)
End Select
Next
[B1].Value = B
End Sub
Do you like it ? So thanks to click on bottom left star icon « ★ Add Reputation » !
Hi Marc L ,
Yes it works perfectly , I appreciated it, would you please implement one more logic so that all English numeric numbers in the CELL A range converted to Bangla number in the CELL B range till last non empty CELL. I mean if CELL A2 have English number it also converted to Bangla number in the CELL B2 as well. Likewise onward ..thanks
As it was not stated within initial post (neither any attachment), you can use a For Each loop on first row …
Hi Marc L , Please the attached excel file.
According to your attachment :
PHP Code:
Sub Demo2()
Dim V, R&, C&, A&
With Range("A2", [A1].End(xlDown))
V = .Value
For R = 1 To UBound(V)
For C = 1 To Len(V(R, 1))
A = AscW(Mid(V(R, 1), C, 1))
Select Case A
Case 48 To 57: Mid(V(R, 1), C, 1) = ChrW(2486 + A)
End Select
Next
Next
.Offset(, 1).Value = V
End With
End Sub
Do you like it ? So thanks to click on bottom left star icon « ★ Add Reputation » !
Last edited by Marc L; 06-11-2018 at 05:58 PM. Reason: optimization …
Hi Marc L , I truly appreciated it , thanks for your valuable time in this regards.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks