One thing that I noticed is that the msgbox "authorizations duplicated" is inside your loops. That means that if you have multiple instances you will get multiple msgboxes.
But, the msgbox is only to inform you of a duplication, the extra boxes aren't needed.
You could set a variable and use that to trigger one message, no matter how many duplicates there are
![]()
' code Dim DupCount as Long ' code For Each c In Target ' ... If c.Value = c.Offset(0, 5).Value Then dupCount = dupCount + 1 c.Value = "" c.Offset(0, 3).Value = "" c.Offset(0, 4).Value = "" Else c.Offset(0, 3).Value = UCase(Environ("USERNAME")) c.Offset(0, 4).Value = Format(Now, "YYYYMMDD HHMMSS") End If '... next c If 0 < dupCount then MsgBox dupCount & " duplicate authorizations" ' ...











LinkBack URL
About LinkBacks
Register To Reply

Bookmarks