Find where repeating values stop in a table

jondavis1987

Active Member
Joined
Dec 31, 2015
Messages
443
Office Version
  1. 2019
Platform
  1. Windows
I have a table that is thousands of rows long. There's seven repeating values in a column with the header Sieve. These values repeat in the same order after each other. Through a pivot table linked to this table i know there are two instances where insted of going No. 40 to No. 200 it goes from No. 40 to 1 1/2". Is there a quick way to find this without going through the thousands and thousands of rows looking for this?

Sieve
1 1/2"
3/4"
3/8"
No. 4
No. 10
No. 40
No. 200
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
See if this will fix your issue. It assumes the data is in column A and that is the only column of data.

VBA Code:
Sub t()
Dim fn As Range, adr As String
Set fn = Range("A2", Cells(Rows.Count, 1).End(xlUp)).Find("No. 40", , xlValues, xlWhole)
    If Not fn Is Nothing Then
        adr = fn.Address
        Do
            If fn.Offset(1) <> "No. 200" Then
                Rows(fn.Offset(1).Row).Insert
                fn.Offset(1) = "No. 200"
            End If
            Set fn = Range("A2", Cells(Rows.Count, 1).End(xlUp)).FindNext(fn)
        Loop While fn.Address <> adr
    End If
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,215,444
Messages
6,124,893
Members
449,194
Latest member
JayEggleton

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