-1

I am trying create a tool to generate bulk salary revision files and facing an issue to get the correct number format in word file when it is copied from excel to msword (using bookmark). What is the best way to get the correct Indian number formats (lakhs & crors) in MS word from excel.

I tried many options using "format" ("##,##,##0") in vba however when the number is ten thousand an extra comma comes in front of the number.

I am new to vba and not very hands on in advanced option. Please also let me know if I can create a function to fix if required.

James Z
  • 12,209
  • 10
  • 24
  • 44
prasad
  • 1
  • 2

1 Answers1

0

Hope following code helps in your problem

Sub format_functions_1()
x = Format(123456789.12345, "##\,##\,##\,##\,##\,##\,##\,##\,###.##") 
For i = 1 To Len(x)
    If Left(x, 1) = "," Then
        x = Mid(x, 2, Len(x))
    Else
        Exit For
    End If

Next i   
MsgBox x
End Sub
Chirag
  • 13
  • 5