You could also consider using the line
If cell.NumberFormat = ActiveCell.NumberFormat Then
which could give you some added flexibility.