Sub test()
Dim last_row As Long
Dim cell As Range
last_row = ThisWorkbook.Worksheets("data").Cells(Rows.Count, 1).End(xlUp).Row
Set cell = Range("F2:F" & last_row)
cell.Formula = "=C2+D2-E2"
cell.Value = cell.Value
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
' Exit if multiple cells updated at once
If Target.CountLarge > 1 Then Exit Sub
If Target.Column = 3 And Target.Row > 1 Then
If Target.Value = "" Then Target.Value = "0"
If Not IsNumeric(Target) Then
MsgBox "please should just enter numbers ", vbCritical
Application.Undo
Exit Sub
End If
Application.EnableEvents = False
Call test
Application.EnableEvents = True
End If
End Sub
yes , by the way the error occures when try save the sheet in new file by another macro .Are both of these procedures in the same workbook?
OK, that is a very critical detail you want to be sure to mention!yes , by the way the error occures when try save the sheet in new file by another macro .
noDoes it give you a debug error option?
But you say you only get the error when running some "other" macro?yes , by the way the error occures when try save the sheet in new file by another macro .
the other macro in standard moduleWhich file does this "other" macro reside in?