-----Original Message-----
Hi Shital!
A bit late but the question is unanswered and is probably in common
demand in India and elsewhere.
There's a problem with "manual" formatting to handle negatives because
the space in the format string usually used for negatives is taken up
with handling positives.
Here's a VBA solution that can be applied to existing number entries:
Sub IndianFormat()
Dim Cell As Range
For Each Cell In Selection
With Cell
Select Case Len(Abs(Int(.Value)))
Case Is <= 3
.NumberFormat = "###;(###)"
Case Is <= 5
.NumberFormat = "##,###;(##,###)"
Case Is <= 7
.NumberFormat = "#\,##\,###;(#\,##\,###)"
Case Is <= 9
.NumberFormat = "#\,##\,##\,###;(#\,##\,##\,###)"
Case Is <= 11
.NumberFormat = "#\,##\,##\,##\,###; (#\,##\,##\,##\,###)"
End Select
End With
Next Cell
End Sub
I'm sure it can be improved upon and there's no reason why it can't be
used in a Worksheet_Change event:
Private Sub Worksheet_Change(ByVal Target As Range)
If Application.Intersect(Target, Range("A1:A20")) Is Nothing Then
Exit Sub
End If
With Target
Select Case Len(Abs(Int(.Value)))
Case Is <= 3
.NumberFormat = "###;(###)"
Case Is <= 5
.NumberFormat = "##,###;(##,###)"
Case Is <= 7
.NumberFormat = "#\,##\,###;(#\,##\,###)"
Case Is <= 9
.NumberFormat = "#\,##\,##\,###;(#\,##\,##\,###)"
Case Is <= 11
.NumberFormat = "#\,##\,##\,##\,###; (#\,##\,##\,##\,###)"
End Select
End With
End Sub
Adapt the range in the first line of the code to whatever range you
want to apply it to.
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
Shital said:
Thanks for ur replay
Can i get India Format style in -ve. that is in (Bracket)
Shital
-----Original Message-----
To do it right you will probably have to use Excel XP,
but then with the International version of Excel, it could
be in your Regional Settings.
This is what you can do in earlier versions of Excel
for positive numbers, and I see you definitely indicated
you want both postive and negatvie.
[>=10000000]##\,##\,##\,##0.00;[>=100000] ##\,##\,##0.00;##,##0.00
(This format separates groups for India/Thailand, format
valid for positive numbers up to 99,99,99,999.99 or
999,999,999.99) in
Excel XP see function BhatText as in Thai Bhat currency.
=BAHTTEXT(A37) [Rupees, Rs., Paise, lakhs, crores] == an
alternative may
be to use Control Panel, Regional Settings, Numbers, digit grouping
http://office.microsoft.com/assistance/offhelp/offxp/exc
el
/xlmain10/html/Bahttext.htm
threadm=3B82C702.75F3C989%
40NoMoreSpammodelfitness.com
"Shital Shah" <
[email protected]> wrote in
message news:
[email protected]...
I want to use Indian Comma style upto 100 crores.
with -
ve
value have to come in ().
like.
100
1,000
10,000
1,00,000
10,00,000
1,00,00,000
10,00,00,000
1,00,00,00,000
with -ve
(100)
(1,000)
(10,000)
(1,00,000)
(10,00,000)
(1,00,00,000)
(10,00,00,000)
(1,00,00,00,000)
is any help
.
.