The original thread got ALL messed up. Anywho attached is a screen of the data I'm working with. Below that is the code I've written along with your segment placed into it. I've updated yours to represent column B and it's running an infinite loop and not removing anything. Any suggestions?
Here is the code:
Your snippet updated to column B:
Here is the code:
Code:
Sub Create_List2()
'
' Create_List2 Macro
'
'Copy Formula tab to List
Sheets("List").Select
Columns("A:A").ClearContents
Sheets("Formula").Select
Columns("A:A").Select
Selection.Copy
Sheets("List").Select
Range("B1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'Find and Replace blanks
Selection.Replace What:="", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Call Work_Off_This
Selection.SpecialCells(xlCellTypeBlanks).Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
Your snippet updated to column B:
Code:
Sub Work_Off_This()
Dim dat1 As String
Dim dat2 As String
Dim lrow As Long, i As Long, x As Long
lrow = Cells(Rows.Count, 2).End(xlUp).Row
For i = 1 To lrow
If Cells(i, 2) = "" Then GoTo Blnk
dat1 = Cells(i, 2).Value
If Cells(i + 1, 2).Value = "" Then GoTo Blnk
dat2 = Cells(i + 1, 2).Value
For x = i + 2 To lrow
If Cells(x, 2).Value = dat1 And Cells(x + 1, 2) = dat2 Then
Cells(x, 2).ClearContents
Cells(x + 1, 2).ClearContents
End If
Next
Blnk:
Next
End Sub