View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Excel-formatting

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range(Target(1).Address), _
Range("C:C, D:D, E:E")) Is Nothing Then Exit Sub
On Error GoTo endit
Application.EnableEvents = False
With Target
.Value = .Value / 10
End With
endit:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code"

Copy/paste the above into that sheet module.

Alt + q to return to the Excel window.


Gord

On Thu, 25 Jun 2009 14:32:01 -0700, Chi
wrote:

Hi Gord,

Sorry if my first post is a bit ambiguous.

Yes! Enter 100 and it becomes 10
Enter 95 and it becomes 9.5


I would like column D, C and E work that way -(Enter 100 and it becomes 10
and enter 95 and it becomes 9.5)


Thank you very much for your patience.

Chi


"Gord Dibben" wrote:

Office ButtonExcel OptionsAdvancedEditing OptionsAutomatically insert a
decimal point.

You would have to use event code for just a few columns.

I can provide that. Which columns are you talking about?

Your first post is a bit ambiguous or some of us are misreading it.

What exactly do you want?

Enter 100 and it becomes 10?

Enter 95 and it becomes 9.5?

That's what I got from your initial description.


Gord



On Thu, 25 Jun 2009 10:51:01 -0700, Chi
wrote:

Hi Gord,

It works!!! Thank you for your explanation. In my case, I need only few
columns, instead of whole sheet. Is there away to do that?
I am using 2007 so would you please also show me where the Fixed Decimal is?

Thanks
Chi


"Gord Dibben" wrote:

The cell values won't change after you uncheck the FD option.

Once entered, they are fixed at that value.

Re-enter numbers.


Gord Dibben MS Excel MVP


On Thu, 25 Jun 2009 10:16:02 -0700, Chi
wrote:

Hi TGV,

Thank you for your help, but It didn't work, not thing happen, after I
uncheck the check box.
Chi

"TGV" wrote:

Tools-Options-Edit-Fixed Decimal - Uncheck the check box or change the Places
value as "0".

TGV

"Chi" wrote:

Hi,

Would you please show me how I can format the cells appear like the below
example?
Ex: if I enter to a cell 100, it will become 10
If I enter to a cell 95, it will become 9.5
And if I enter to a cell 90, it will show 9.

Thanks
Chi

Chi