Hi there! I have a macro to do something if 1 cell is changed, and I am interesting, how can I prevent the sub below from running if multiple cells are changed at a time (copy an array of values must be prohibited, and I want to have an opportunity to delete data, from A2:end of document) I know that I can create a sub to delete values, after pressing a button for example, but for end-user it can be not so great.
and the second question: is it possible to put this sub into Workbook so it will be the same for all sheets?
Thanks in advance!
Serhii
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim CurrentRow As Integer
Dim NumberOfUnitsPerCase As Integer
If Intersect(Target, Me.Range("A:A")) Is Nothing Then Exit Sub
CurrentRow = Target.Row
If (Target.Cells.Value = "") Then Exit Sub
NumberOfUnitsPerCase = 24
Call CheckScannedBarcode(CurrentRow, NumberOfUnitsPerCase)
End Sub
Thanks in advance!
Serhii
Last edited: