View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Percentage function

You could use event code to change the value when you enter it but then you have
no "paper trail" for error-checking.

I like Max's idea of a helper column so's you can see and make corrections if
needed.

If you want the change-in-cell event code for interest, here it is.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A10")) Is Nothing Then
With Target
If .Value < "" Then
.Value = .Value * 0.04
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code".

Copy/paste the code into that sheet module.

Adjust range to suit.


Gord Dibben MS Excel MVP

On Mon, 7 Jan 2008 15:23:01 -0800, Rachel Bixby <Rachel
wrote:

I am trying to create a document that if you enter a number into a certain
cell the same cell will auto-populate with what 4% is of the # you entered.

Example:
1) Enter 1,000 into cell
2) The same cell auto populates with 4% of 1,000 which would of course be 40

Can someone please explain to me how to get the formula right and where all
of the information should be entered? Thanks in advance :) !