Hi,
I am trying to create a macro that will be able to select a UPC code from the "Daily Usage" Sheet and correspond it to the same UPC code from the "Total Data" Sheet and delete them both and move them both up (no blank spaces). Here is what I have so far. I tried to correspond it by trying to compare the Time Value, but I found out that the time value will be off by 1 second sometimes because it takes a little time for it to be scanned on "Daily Usage" and copied/pasted to the "Total Data" (I created a macro for that already)
Sub Delete()
Dim xScreenUpdating As Boolean
Dim DailyUsedUPC As Range
Dim UsedUPC As Range
Dim xTxt As String
On Error Resume Next
xTxt = ActiveWindow.RangeSelection.Address
Set DailyUsedUPC = Application.InputBox("Select UPC code to delete", "Delete UPC", xTxt, , , , , 8)
If DailyUsedUPC Is Nothing Then
MsgBox "Canceled"
DailyUsedUPC.Delete Shift:=xlUp
Sheets("Used").Select
End If
Application.ScreenUpdating = xScreenUpdating
End Sub
Edit: I also forgot to mention that I don't want it to be cell referenced directly because the "Daily Usage" Sheet will be cleared every day while the "Total Data" sheet won't be. I just want to have the option to delete a UPC code from both sheets in case a worker accidentally scans something twice.
Bookmarks