The Do Until statement works perfectly; however, I cannot continue past the first worksheet. Thank you in advance for any help.
Option Explicit
Sub InsertBlankRow()
Dim rowCount As Long
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
rowCount = 2
With ws
Do Until IsEmpty(Cells(rowCount + 1, "D"))
If (Cells(rowCount, "D") <> Cells(rowCount + 1, "D")) Then
Range(Cells(rowCount + 1, "D"), Cells(rowCount + 2, "D")).EntireRow.Insert Shift:=xlDown
rowCount = rowCount + 3
Else
rowCount = rowCount + 1
End If
Loop
End With
Next ws
End Sub
Thank you all for the responses. Using the ws.Cells and ws.Rows caused the Do Until statement to not work. Once I removed ws. the rows were able to be added. It still will not loop through all the worksheets though.
Edited the code to provide what I am currently working with.