Sunday, 14 August 2011

Indian Rupee Format

Click on the link below to study my file.
Excel Macro for Indian Rupee Format

When you try to format any number in Excel Spreadsheet it is usually formatted as million. The commas are put after three digits, and again after another 3 digits. But in India we put the first comma after the three digits and then after next two digits, because we talk in terms of lacs. Ten lacs is equal to one million. If you need to put the comma in the place of lac, there is no direct formatting option. But there is a work around. You can do the same with a macro. The following is the code of the macro.
________________________________________________________
Sub lacs()
For Each c In Selection

Select Case Abs(c.Value)

Case Is < 100000


c.Cells.NumberFormat = "##,##0.00"
Case Is < 10000000


c.Cells.NumberFormat = "#\,##\,##0.00"
Case Is < 1000000000

c.Cells.NumberFormat = "#\,##\,##\,##0.00"
Case Is < 1000000000

c.Cells.NumberFormat = "#\,##\,##\,##0.00"
Case Is < 100000000000#

c.Cells.NumberFormat = "#\,##\,##\,##\,##0.00"
Case Else



c.Cells.NumberFormat = "#\,##\,##\,##\,##\,##0.00"
End Select


Next c



End Sub
____________________________________________________

Then you attach this macro to a button, and use this button to format any cell in Indian Rupee Format as needed by you.

Click on the link below to study my file.

Excel Macro for Indian Rupee Format





No comments:

Post a Comment