Hi,
I have a sheet that I use for tracking invoices and have written VBA to highlight if an invoice with the same number has already been entered in column K as follows:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 11 Then
If WorksheetFunction.CountIf(Columns("K"), Target.Value) > 1 Then MsgBox "Duplicate Invoice no.! Check that this invoice has not already been entered for this supplier", vbInformation
End If
End Sub
It all works great but now I want to pass this on to someone but would like to add to the above by giving an explicit message as to what cell in column K the duplictae arises if found so as to help the end user, is this possible? Any help much appreciated.
Thanks
Mike
I have a sheet that I use for tracking invoices and have written VBA to highlight if an invoice with the same number has already been entered in column K as follows:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 11 Then
If WorksheetFunction.CountIf(Columns("K"), Target.Value) > 1 Then MsgBox "Duplicate Invoice no.! Check that this invoice has not already been entered for this supplier", vbInformation
End If
End Sub
It all works great but now I want to pass this on to someone but would like to add to the above by giving an explicit message as to what cell in column K the duplictae arises if found so as to help the end user, is this possible? Any help much appreciated.
Thanks
Mike