Bobba the Fat
New Member
- Joined
- Mar 8, 2017
- Messages
- 2
Hello.
I need my macro to automatically multiply the value I enter in the cell (by *9.81) and to return the result to the same cell. I have gotten this code, but I can't set the Range of my macro to work in. I would like this macro to work just in columns BH:BJ, BM:BO, BR:BT, BW:BY, CB:CD, CG:CI, CL:CN and CQ:CS.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Target.Value <> "" Then
Application.EnableEvents = False
Target.Value = Target.Value * 9.81
End If
errhandler:
Application.EnableEvents = True
End Sub
Thank you for your cooperation!
May the force be with you
I need my macro to automatically multiply the value I enter in the cell (by *9.81) and to return the result to the same cell. I have gotten this code, but I can't set the Range of my macro to work in. I would like this macro to work just in columns BH:BJ, BM:BO, BR:BT, BW:BY, CB:CD, CG:CI, CL:CN and CQ:CS.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Target.Value <> "" Then
Application.EnableEvents = False
Target.Value = Target.Value * 9.81
End If
errhandler:
Application.EnableEvents = True
End Sub
Thank you for your cooperation!
May the force be with you