It took a bit of experimentation but here is what worked for me. I assumed that the cell that got changed was in the range "C1:C20". I simply put a change event on the sheet. Cells changed by formula will not trigger an event. But cells written to by VB code can trigger an event.
Target is the cell that changed.![]()
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("C1:C20")) Is Nothing Then Exit Sub MsgBox Target.Address End Sub
I used the following code to trigger it.
![]()
Sub test() Dim Scanned_Item As Variant Scanned_Item = InputBox("Scan the item") Range("C10") = Scanned_Item End Sub
Bookmarks