#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Formula

I'm trying to format or use a formula that when i put a value in a cell to
divide by 12.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Formula

=A2/12 if you want a formula.

If you want to divide the values in one or more existing cells, put 12 in a
spare cell, copy it, then select your cells, and Edit/ Paste Special/
Divide. (... after which you can delete the 12 from the spare cell.)
--
David Biddulph

"Jrmy" wrote in message
...
I'm trying to format or use a formula that when i put a value in a cell to
divide by 12.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Formula


Yea I have no problem doing each cell. But I have like 200 cells to do and I
was wondering if i could highlight the whole row or before I put in the value
have it set up. Something like =A/12. but that doesn't work

"David Biddulph" wrote:

=A2/12 if you want a formula.

If you want to divide the values in one or more existing cells, put 12 in a
spare cell, copy it, then select your cells, and Edit/ Paste Special/
Divide. (... after which you can delete the 12 from the spare cell.)
--
David Biddulph

"Jrmy" wrote in message
...
I'm trying to format or use a formula that when i put a value in a cell to
divide by 12.




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Formula

You cannot format a cell to divide and entered number by 12

You can use a helper cell with a formula =A1/12 in B1 or event code to
divide when you enter the number.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("A1:A10")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If IsNumeric(.Value) Then
.Value = .Value / 12
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub

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

Copy/paste into that module.

Edit the range to suit then Alt + q to return to the Excel window.


Gord Dibben MS Excel MVP

On Fri, 17 Oct 2008 14:51:00 -0700, Jrmy wrote:

I'm trying to format or use a formula that when i put a value in a cell to
divide by 12.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Formula

I'm using a old computer with 2000 will this work with that? Gov computers
pfft ;)

"Gord Dibben" wrote:

You cannot format a cell to divide and entered number by 12

You can use a helper cell with a formula =A1/12 in B1 or event code to
divide when you enter the number.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("A1:A10")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If IsNumeric(.Value) Then
.Value = .Value / 12
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub

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

Copy/paste into that module.

Edit the range to suit then Alt + q to return to the Excel window.


Gord Dibben MS Excel MVP

On Fri, 17 Oct 2008 14:51:00 -0700, Jrmy wrote:

I'm trying to format or use a formula that when i put a value in a cell to
divide by 12.





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Formula

Yes, it will work in Excel 2000

Gord

On Fri, 17 Oct 2008 15:37:00 -0700, Jrmy wrote:

I'm using a old computer with 2000 will this work with that? Gov computers
pfft ;)

"Gord Dibben" wrote:

You cannot format a cell to divide and entered number by 12

You can use a helper cell with a formula =A1/12 in B1 or event code to
divide when you enter the number.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("A1:A10")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If IsNumeric(.Value) Then
.Value = .Value / 12
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub

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

Copy/paste into that module.

Edit the range to suit then Alt + q to return to the Excel window.


Gord Dibben MS Excel MVP

On Fri, 17 Oct 2008 14:51:00 -0700, Jrmy wrote:

I'm trying to format or use a formula that when i put a value in a cell to
divide by 12.




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Formula

There's something wrong with the code

"Gord Dibben" wrote:

Yes, it will work in Excel 2000


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Formula

Is this a request for further assistance or just a declarative statement?

There is nothing wrong with the code.


Gord

On Mon, 20 Oct 2008 17:49:00 -0700, Jrmy wrote:

There's something wrong with the code

"Gord Dibben" wrote:

Yes, it will work in Excel 2000


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"