Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Dividing input by a constant

Is there a way to create a formula or macro that when I enter a number in a
cell it will automatically divide 5.7?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Dividing input by a constant

Hi,

Right click the sheet tab, View code and paste this in. Change the range to
suit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then' change to suit
If IsNumeric(Target) Then
On Error Resume Next
Application.EnableEvents = False
Target = Target / 5.7
Application.EnableEvents = True
On Error GoTo 0
End If
End If
End Sub

Mike

"BabyBlueAXiD" wrote:

Is there a way to create a formula or macro that when I enter a number in a
cell it will automatically divide 5.7?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Dividing input by a constant

THAT WORKS PERFECT!Thanks so much!

"Mike H" wrote:

Hi,

Right click the sheet tab, View code and paste this in. Change the range to
suit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then' change to suit
If IsNumeric(Target) Then
On Error Resume Next
Application.EnableEvents = False
Target = Target / 5.7
Application.EnableEvents = True
On Error GoTo 0
End If
End If
End Sub

Mike

"BabyBlueAXiD" wrote:

Is there a way to create a formula or macro that when I enter a number in a
cell it will automatically divide 5.7?

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Constant loan payments vs. constant payments of principal lalli945 Excel Worksheet Functions 3 December 20th 06 10:33 PM
My excel spread sheets are dividing all numbers input by 100. Prospector Excel Worksheet Functions 3 July 21st 06 10:47 AM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
How do I add input data in the input ranges in drop down boxes. oil_driller Excel Discussion (Misc queries) 1 November 9th 05 10:31 PM
=SUMIF(Input!H2:H718,AZ19,Input!E2:E685)AND(IF ALex Excel Worksheet Functions 2 March 14th 05 09:19 PM


All times are GMT +1. The time now is 03:33 PM.

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

About Us

"It's about Microsoft Excel"