I have the change macro below and I am trying to amend it so that it only runs where there is a change event in the sheet it's in and C2
of Previous
is not 1
. I can't seem to get it right (but I am a novice).
The code is in Sheet1
module. Sheet1
is refreshed frequently by external software and I exit the Worksheet_Change
routine if it's not the data refresh I want. Price data
is the refresh I want and is the first fresh it covers cell A1:P
& whatever the last row is, that is 16
columns. The second refresh refreshes the remaining
columns but I don't want the macro to be triggered by this event
Can anyone see what I've done wrong?
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Columns.Count <> 16 Then Exit Sub
Application.EnableEvents = False
If ThisWorkbook.Sheets("Previous").Range("C2").Value <> 1 Then Call InsertDetails
Application.EnableEvents = True
End Sub