Data Validation - Actually finding the circled invalid data

Neutralizer

Board Regular
Joined
Sep 23, 2009
Messages
53
Hi,

Does anyone know of a way to automatically move the first/next cell that contains invalid data?

At the moment I'm having to scroll manually through it looking for the circles which is time consuming, because this sheet is pretty big...

By invalid data, i mean cells that are circled when using the 'Circle Invalid Data' option are data validation.

Cheers
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi,

Here is one approach you can try:

Run the vba code provided here (there are complete instructions on how to do so): http://support.microsoft.com/kb/213773

This adds actual shapes to your worksheet around all the invalid cells. Now if you select one of the shapes and press tab you'll move to the next shape i.e. the next invalid cell.

Once your done you can easily remove the shapes by running the 'RemoveValidationCircles' macro.
 
Upvote 0
Repeatedly calling this function will cycle through the Validation errors on the activeSheet

Code:
Sub NextValidationError()
    Dim vCell As Range, nextCell As Range, firstCell As Range
    On Error GoTo ErrorOut
    Set nextCell = Nothing: Set firstCell = Nothing
    
    For Each vCell In ActiveSheet.Cells.SpecialCells(xlCellTypeAllValidation)
        With vCell
            If Not (.Validation.Value) Then
                If firstCell Is Nothing Then Set firstCell = vCell
                If nextCell Is Nothing Then Set nextCell = vCell
            End If
            If .Address = Selection.Address Then
                Set nextCell = Nothing
            End If
        End With
    Next vCell
    
    If nextCell Is Nothing Then Set nextCell = firstCell
    nextCell.Select
    
ErrorOut:
    Err.Clear
    On Error Goto 0
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,843
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top