Sub Indianrupees()
On Error GoTo Anand:
Dim rcell As Range
Dim rrupeerange As Range
Set rcell = ActiveCell
Set rrupeerange = Application.InputBox(prompt:="Select a cell or a Range ", Type:=8, _
Default:=Selection.Address)
areacount = rrupeerange.Cells.Count
If areacount < 65000 Then
Application.StatusBar = "Wait while System Converts into Indian Rupee Format....!"
Application.ScreenUpdating = False
For Each rcell In rrupeerange
Select Case rcell.Value
Case Is >= 1E+15
rcell.Cells.NumberFormat = _
"##"",""00"",""00"",""00"",""00"",""00"",""00"",""000.00"
Case Is >= 10000000000000#
rcell.Cells.NumberFormat = _
"##"",""00"",""00"",""00"",""00"",""00"",""000.00"
Case Is >= 100000000000#
rcell.Cells.NumberFormat = _
"##"",""00"",""00"",""00"",""00"",""000.00"
Case Is >= 1000000000
rcell.Cells.NumberFormat = "##"",""00"",""00"",""00"",""000.00"
Case Is >= 10000000
rcell.Cells.NumberFormat = "##"",""00"",""00"",""000.00"
Case Is >= 100000
rcell.Cells.NumberFormat = "##"",""00"",""000.00"
Case Else
rcell.Cells.NumberFormat = "##,###.00"
End Select
Next rcell
Application.ScreenUpdating = True
Set rcell = Nothing
Set rrupeerange = Nothing
Application.StatusBar = ""
Else
a = MsgBox("You had selected Total " & areacount & " Cells, Want to Proceed ? ", _
vbYesNo, "Anand M. Bohra")
If a = vbYes Then
Application.StatusBar = "Wait while System Converts into Indian Rupee Format....!"
Application.ScreenUpdating = False
For Each rcell In rrupeerange
Select Case rcell.Value
Case Is >= 1E+15
rcell.Cells.NumberFormat = _
"##"",""00"",""00"",""00"",""00"",""00"",""00"",""000.00"
Case Is >= 10000000000000#
rcell.Cells.NumberFormat = _
"##"",""00"",""00"",""00"",""00"",""00"",""000.00"
Case Is >= 100000000000#
rcell.Cells.NumberFormat = _
"##"",""00"",""00"",""00"",""00"",""000.00"Case Is >= 1000000000
rcell.Cells.NumberFormat = "##"",""00"",""00"",""00"",""000.00"
Case Is >= 10000000
rcell.Cells.NumberFormat = "##"",""00"",""00"",""000.00"
Case Is >= 100000
rcell.Cells.NumberFormat = "##"",""00"",""000.00"
Case Else
rcell.Cells.NumberFormat = "##,###.00"
End Select
Next rcell
Application.ScreenUpdating = True
Set rcell = Nothing
Set rrupeerange = Nothing
Application.StatusBar = ""
Else
MsgBox "Select Smaller data for Faster Formatting", vbInformation, _
"Anand M. Bohra"
End If
End If
Exit Sub
Anand:
MsgBox "Oopss...........!", vbCritical, "Anand M. Bohra"
End Sub