Click here to Skip to main content
15,906,626 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi There Good day,

I want to format amount i.e 1000000 to 10,00,000.

I have tried the following:

Format(Fields!Amount.Value, "N")

, Format(Fields!Amount.Value, "#,#")

But Doesn't work.

Thanks in advance
Posted

=Format(CDec(Amount.Value),"N")
 
Share this answer
 
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

On Error Goto ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If IsNumeric(.Value) Then
If .Value > 0 Then
.NumberFormat = "[>=10000000]#\,##\,##\,##0;[>=100000]##\,##\,##0;##,##0"
ElseIf .Value < 0 Then
.NumberFormat = "[<=-10000000]-#\,##\,##\,##0;[<=-100000]-##\,##\,##0;##,##0"
End If
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900