I am hoping I can get some help. I found a macro that other say works well that I would like to use, however I cannot get it to run. I paste it in and then the macro isn't there to choose to run. Attached is the basic rough draft of what I need.
The Macro that I found and wanted to use is below. I am running Excel 2010, not sure if that is the issue or if I am pasting it in wrong or what but its getting very frustrating. Any help would be very much appreciated!
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$A$4" 'add
If Target.Value <> "" Then
On Error Resume Next
Set xitem = Range("C8", Range("C" & Rows.Count) _
.End(xlUp)).Find(Range("A4").Value)
With xitem.Offset(0, -1)
.Value = .Value + 1
End With
On Error GoTo 0
If xitem Is Nothing Then
MsgBox "The item scanned is not on the list."
End If
Range("A4") = ""
Range("A4").Select
End If
Case "$C$4" 'remove
If Target.Value <> "" Then
On Error Resume Next
Set xitem = Range("C8", Range("C" & Rows.Count).End(xlUp)) _
.Find(Range("C4").Value)
With xitem.Offset(0, -1)
.Value = .Value - 1
End With
If xitem Is Nothing Then MsgBox Target & " cannot be found " _
& "and cannot be removed."
Range("C4") = ""
Range("C4").Select
On Error GoTo 0
End If
Case "$E$4" 'find
If Target.Value <> "" Then
On Error Resume Next
Set xitem = Range("C8", Range("C" & Rows.Count).End(xlUp)) _
.Find(Range("E4").Value)
If xitem Is Nothing Then
MsgBox Target & " was not found."
Range("E4").Select
End If
Range("E4") = ""
xitem.Select
On Error GoTo 0
End If
End Select
End Sub
Bookmarks