One way to do this is via the application events.
Use the change event for the applications sheet.
eg.
Assumng the range to divide by 12 is A1:A10
Private Sub Worksheet_Change(ByVal Target As Range)
Dim DivRg As Range
Set DivRg = Range("A1:A10")
Set DivRg = Application.Intersect(Target, DivRg)
If DivRg Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
Target = Target / 12
Application.EnableEvents = True
Set DivRg = Nothing
End Sub
Ivan
Another question and need a little more help
Thanks for yor response Ivan. I don't have a range that needs to be divided. For example, whatever I enter in cell A12, I want automatically divided by 12. So if I enter $1,200.00 I want that divided by 12. How do I change your formula to do this? I just started using Excel three days ago so I'm still green about this - I actually wouldn't even know where to put your formula in, I really didn't think it would be so complicated. Thanks again.
One way to do this is via the application events.
Use the change event for the applications sheet.
eg.
Assumng the range to divide by 12 is A1:A10
Private Sub Worksheet_Change(ByVal Target As Range)
Dim DivRg As Range
Set DivRg = Range("A1:A10")
Set DivRg = Application.Intersect(Target, DivRg)
If DivRg Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
Target = Target / 12
Application.EnableEvents = True
Set DivRg = Nothing
End Sub
Re: Another question and need a little more help
Lori
Sorry....should have explained further.
The routine below is a macro that is run when
(In this case) an event = Worksheet change
is triggered ie. when ever you change a cell
or range this event is initiated.
This particular event is @ the Worksheet(Tab)
level, so to enter this;
1) Right click your sheet tab that you want it
to run in.
2) select view code
3) paste it in.
Private Sub Worksheet_Change(ByVal Target As Range)
'Dim DivRg As Range
If Target.Address <> "$A$12" Or Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
Target = Target / 12
Application.EnableEvents = True
End Sub
Repost if further help needed
Ivan
Re: Another question and need a little more help
Thanks for your quick response Ivan, I will give it a try and let you know how it works out!