excel 97 how can i transform in the same cell 1.256.324 in 125.63

P

puiuluipui

I want to transform in excel 97, a number ( ex: 1.256.324 in 125.63) bu
in the same cell. How can i do this?

In my country money changed from 10.000 in 1 ; 100.000 , in 10...etc
So i want excel to transform for me automatically an old sum of mone
in the new one. I want to write 1.256.324, and when i press enter thi
number to be transformed in 125.63. Thanx .... And thanx...:
 
D

Dave Peterson

One way is to use a worksheet event that looks for a change and reacts to your
typing.

You can try this code:

RightClick on the worksheet tab that should have this behavior. Select view
code and paste this into the code window that opens up:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

With Target
If .Cells.Count > 1 Then Exit Sub
If Intersect(.Cells, Me.Range("a:a")) Is Nothing Then Exit Sub
If IsEmpty(.Value) Then Exit Sub
If IsNumeric(.Value) = False Then Exit Sub

On Error GoTo errHandler:
Application.EnableEvents = False
.Value = Format(.Value / 10000, "0.00")
End With

errHandler:
Application.EnableEvents = True
End Sub


This routine only looks at changes in column A. You'll have to adjust that if
your data entry is elsewhere.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

You can read more about these kinds of events at:
Chip Pearson's site:
http://www.cpearson.com/excel/events.htm

David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/event.htm
 
Top