You need to remove the +1 from the do until
Do Until inSht.Cells(i + 1, 1) = ""
or heres another option
Sub abc()
Const shRawData As String = "Sheet2" '<== Change as needed
Const shOutput As String = "Output" '<== Change as needed
Dim a, b, i As Long, ii As Long, n As Long
With Worksheets(shRawData)
a = .Range("a1").CurrentRegion
End With
ReDim b(1 To Rows.Count, 1 To 2)
For i = 2 To UBound(a, 1)
For ii = 2 To UBound(a, 2)
If IsEmpty(a(i, ii)) Then Exit For
n = n + 1
b(n, 1) = a(i, 1)
b(n, 2) = a(i, ii)
Next
Next
With Worksheets(shOutput)
.Columns("a:b").Clear
.Range("a1") = "State"
.Range("a2").Resize(n, UBound(b, 2)) = b
End With
End Sub
Bookmarks