Dear Sirs,
I am just started macror/vba coding.
I have created a coding for displaying number in Indian currency in indian format(comma separator) in excel 2007. Though it is working in the first sheet It is not working in all the sheets. Please guide me on this.
I would like to learn how to protect the coding. If am sending this file to others other users should not view the coding.
code i have used as follows
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Value >= 1000 And Target.Cells.Value < 10000 Then
Target.Cells.NumberFormat = "#"",""###.00"
ElseIf Target.Cells.Value >= 10000 And Target.Cells.Value < 100000 Then
Target.Cells.NumberFormat = "##"",""###.00"
ElseIf Target.Cells.Value >= 100000 And Target.Cells.Value < 1000000 Then
Target.Cells.NumberFormat = "#"",""##"",""###.00"
ElseIf Target.Cells.Value >= 1000000 And Target.Cells.Value < 10000000 Then
Target.Cells.NumberFormat = "##"",""##"",""###.00"
ElseIf Target.Cells.Value >= 10000000 And Target.Cells.Value < 100000000 Then
Target.Cells.NumberFormat = "#"",""##"",""##"",""###.00"
ElseIf Target.Cells.Value >= 100000000 And Target.Cells.Value < 1000000000 Then
Target.Cells.NumberFormat = "##"",""##"",""##"",""###.00"
ElseIf Target.Cells.Value >= 1000000000 And Target.Cells.Value < 10000000000 Then
Target.Cells.NumberFormat = "###"",""##"",""##"",""###.00"
End If
End Sub
Thanks & Regards
N.Srinivasan
Bookmarks