'Show messagebox if data is not according to format

I've got a pivot table and in that pivot table there's one column that needs a validation check. If in this column there's no email adres than I need to show a messagebox. So there needs to be a check on the format. Data validation is not possible in a pivot table. Anyone can help me with this one?



Solution 1:[1]

You can use this construction:

our_range = Range("A1:A100") '  your range or user-defined selection
For each cell in our_range:
    if isempty(cell) then msgbox "Cell "+cstr(cell.address)+" is empty!"
    if instr(cell.value, "@") = 0 then msgbox "Cell "+cstr(cell.address)+" isn't an e-mail!"
next cell

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vovakirdan