Value in indian comma seperation

DHAWAL

New Member
Joined
Oct 10, 2022
Messages
9
Office Version
  1. 2016
Platform
  1. Windows
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 ..?
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Try this macro.
You should put the below macro in your WORKSHEET (ex. sheet1) and write some marco to prevent unexpected errors.
'===========
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call IndianNumberFormat
End Sub
 
Upvote 0
It doesn't work, i have to run macro again..
Please help
 
Upvote 0
is there is any other code through which it shows value in indian comma speration style and whenever value is updated it will automatically show value in indian comma speration style only.
 
Upvote 0

Forum statistics

Threads
1,217,032
Messages
6,134,111
Members
449,861
Latest member
DMJHohl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top