I want to show value in India comma separation style, I have used this marco
Sub IndianNumberFormat()
For Each c In Selection
Select Case Abs(c.Value)
Case Is < 100000
c.Cells.NumberFormat = "##,##0.00 ;[RED]-##,##0.00"
Case Is < 10000000
c.Cells.NumberFormat = "#\,##\,##0.00 ;[RED]-#\,##\,##0.00"
Case Is < 1000000000
c.Cells.NumberFormat = "#\,##\,##\,##0.00 ;[RED]-#\,##\,##\,##0.00"
Case Is < 1000000000
c.Cells.NumberFormat = "#\,##\,##\,##0.00 ;[RED]-#\,##\,##\,##0.00"
Case Is < 100000000000#
c.Cells.NumberFormat = "#\,##\,##\,##\,##0.00 ;[RED]-#\,##\,##\,##\,##0.00"
Case Else
c.Cells.NumberFormat = "#\,##\,##\,##\,##\,##0.00 ;[RED]-#\,##\,##\,##\,##\,##0.00"
End Select
Next c
End Sub
Its run perfectly but when I change value from lakhs to thousand or crores to lakhs it shows value like this
,,25,000.00
It shows “,” before value, I have to run macro again to show this value 25,000,
Can anyone has dynamic macro that will work on any value or When I change value it will run macro again so that above error will not occur
can anyone help please ..?
Sub IndianNumberFormat()
For Each c In Selection
Select Case Abs(c.Value)
Case Is < 100000
c.Cells.NumberFormat = "##,##0.00 ;[RED]-##,##0.00"
Case Is < 10000000
c.Cells.NumberFormat = "#\,##\,##0.00 ;[RED]-#\,##\,##0.00"
Case Is < 1000000000
c.Cells.NumberFormat = "#\,##\,##\,##0.00 ;[RED]-#\,##\,##\,##0.00"
Case Is < 1000000000
c.Cells.NumberFormat = "#\,##\,##\,##0.00 ;[RED]-#\,##\,##\,##0.00"
Case Is < 100000000000#
c.Cells.NumberFormat = "#\,##\,##\,##\,##0.00 ;[RED]-#\,##\,##\,##\,##0.00"
Case Else
c.Cells.NumberFormat = "#\,##\,##\,##\,##\,##0.00 ;[RED]-#\,##\,##\,##\,##\,##0.00"
End Select
Next c
End Sub
Its run perfectly but when I change value from lakhs to thousand or crores to lakhs it shows value like this
,,25,000.00
It shows “,” before value, I have to run macro again to show this value 25,000,
Can anyone has dynamic macro that will work on any value or When I change value it will run macro again so that above error will not occur
can anyone help please ..?