Hi I have the code
what it is currently doing is once I run my sheet, the file updates. But when I work on the sheet it updates every time. It there a way where I can make the code run once and when I am updating the sheet it doesn't update repeatedly ?
Thanks in advanced
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x As Long
Dim LR As Long
Dim C4 As Variant
C4 = Worksheets("P").Cells(4, 3).Value
Application.EnableEvents = False
With Worksheets("S")
LR = .Cells(.Rows.Count, 1).End(xlUp).Row
For x = 1 To LR
If .Cells(x, 2).Value = C4 Then .Cells(x, 7).Value = .Cells(x, 3).Value
Next x
End With
Worksheets("S").Activate
Worksheets("S").Range("F1").End(xlDown).Select
Worksheets("S").Range(Selection, Selection.End(xlDown).Offset(0, 2)).copy
Worksheets("P").Range("B17").PasteSpecial xlPasteValues
Application.EnableEvents = True
what it is currently doing is once I run my sheet, the file updates. But when I work on the sheet it updates every time. It there a way where I can make the code run once and when I am updating the sheet it doesn't update repeatedly ?
Thanks in advanced