Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
when i key in a cell with a number i want that to be divided by 40 Thanks Fernandez |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Right click the sheet tab, view code and paste this in. Works on the range A1
- A100 so change to suit. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count 1 Or Target.HasFormula Or IsEmpty(Target) Then Exit Sub If Not Intersect(Target, Range("A1:A100")) Is Nothing Then 'Change to suit If IsNumeric(Target) Then Application.EnableEvents = False Target = Target / 40 Application.EnableEvents = True On Error GoTo 0 End If End If End Sub Mike "Fernandez" wrote: Hi, when i key in a cell with a number i want that to be divided by 40 Thanks Fernandez |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Count 1 Then Exit Sub If Target.Address = "$B$5" Then If Not IsNumeric(Target.Value) Then Exit Sub Application.EnableEvents = False With Target .Value = .Value / 40 Application.EnableEvents = True End With End If End Sub Right-click on the sheet tab and "View Code" Copy/paste the above into that module. Adjust the $B$5 to suit. You did not give enough information to tailor a specific cell or range of cells. For the entire sheet, just remove that line and the End If line. Alt + q to return to Excel. Gord Dibben MS Excel MVP On Tue, 19 Feb 2008 05:02:02 -0800, Fernandez wrote: Hi, when i key in a cell with a number i want that to be divided by 40 Thanks Fernandez |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
auto correct option | Setting up and Configuration of Excel | |||
Auto fill option | New Users to Excel | |||
Auto-filter option | Excel Discussion (Misc queries) | |||
auto save option | Setting up and Configuration of Excel | |||
Divide one row over other row I dont wont to divide one number | Excel Discussion (Misc queries) |