Private Sub Worksheet_Change(ByVal Target As Range) Dim KeyCells As Range ' The variable KeyCells contains the cells that will ' cause execution of macrocomandă1 when they are changed. Set KeyCells = Range("H10:H1000") If Not Application.Intersect(KeyCells, Range(Target.Address)) _ Is Nothing Then Macrocomandă1 End If End Sub
This macro will execute the first macro whenever a cell in range H10:H1000 is modified..
|