I have the following code:
Private Sub Worksheet_Change(ByVal Target As Range)
i = Target.Row
If Intersect(Target, Range("celdas")) Is Nothing Then Exit Sub
Range("AG" & i).Value = "x"
If Target.Count > 1 Then
Range("AG" & i & ":" & "AG" & i + Target.Count).FillDown
The problem is that the Worksheet is used as an interface to retrieve, modify and update data in a SQL database. (Only the rows that contain an X in column AG)
This part of the code just will add an "x" in the row where the user is doing a change in the fields that will be updated (Named Range: celdas)
I don't know why When the query is refreshed the complete AG column appears with an X in the cells...
Is crazy but is happening only in one of the files (I have three other files with the same code and nothing happens when the query is refreshed).
Maybe there is a "before query refresh code" that could stop the code I posted to run while refreshing ?...or there is any other way to avoid this issue ?
Any help is really appreciated.
Thank you for your time.