Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / March 2008

Tip: Looking for answers? Try searching our database.

Dividing input by a constant

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BabyBlueAXiD - 20 Mar 2008 16:35 GMT
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?
Mike H - 20 Mar 2008 16:43 GMT
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

> 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?
BabyBlueAXiD - 20 Mar 2008 16:51 GMT
THAT WORKS PERFECT!Thanks so much!

> Hi,
>
[quoted text clipped - 18 lines]
> > 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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.