Hey Guys, I need a function that do a loop through all cells in worksheet based in criteria, not allowing data entry of duplicates values. The criteria I'll put in function for example:
Public Function NoToDuplicate(column as interger)
'The loop
...
Msgbox ("This is a duplicate value")
...
End Function
Private Sub Worksheet_Change(ByVal Target As Range)
Call NoToDuplicate(1)
End Sub
For Example:
Everytime when I'll put some value in column (myCriteria - for example "A" column), the function will check if there's the same value in all cells of the column (myCriteria - for example "A" column) of all sheets of my workbook.
All 'A Columns' of all sheets from the same workbook will be checked and if there's duplicate value a msgbox ("This is a duplicate value")
Luthius
Public Function NoToDuplicate(column as interger)
'The loop
...
Msgbox ("This is a duplicate value")
...
End Function
Private Sub Worksheet_Change(ByVal Target As Range)
Call NoToDuplicate(1)
End Sub
For Example:
Everytime when I'll put some value in column (myCriteria - for example "A" column), the function will check if there's the same value in all cells of the column (myCriteria - for example "A" column) of all sheets of my workbook.
All 'A Columns' of all sheets from the same workbook will be checked and if there's duplicate value a msgbox ("This is a duplicate value")
Luthius