Hi
Put the code in the Worksheet_Change event for the sheet (double click
the sheet in the VBE, change (General) at the top to worksheet and
choose the event in the right hand dropdown. For most workbook level
events there is a corresponding worksheet level event.
Alternatively, you can change the existing code to work only on
specified sheets
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
If Sh.Name = "MySheet" then
If Not Intersect(Target, Range("c13:c22")) Is Nothing Then
ActiveCell.Offset(0, 2).Value = ActiveCell.Value *
ActiveCell.Offset(0, 1).Value
End If
End if
End Sub
regards
Paul
On Apr 22, 5:30*pm, headly <hea...@discussions.microsoft.com> wrote:
> Have code that reads (thanks to ozgrid)
>
> Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
>
> If Not Intersect(Target, Range("c13:c22")) Is Nothing Then
> ActiveCell.Offset(0, 2).Value = ActiveCell.Value * ActiveCell.Offset(0,
> 1).Value
> End If
>
> but that effects the range c13:c22 on all sheets; How do I keep it specific
> to a particular sheet?
>
> TIA
|