How about this:
Sub Last()
Dim intRow As Integer
Dim ws1 As Worksheet: Set ws1 = Sheets("Sheet1")
Dim ws2 As Worksheet: Set ws2 = Sheets("Sheet2")
Dim x As Long: x = 0
For intRow = 1 To ws1.Range("A" & Rows.Count).End(xlUp).Row
For lngNumber = ws1.Cells(intRow, 1) To CLng(Left(ws1.Cells(intRow, 1), 6) & ws1.Cells(intRow, 2))
ws2.Range("A" & Rows.Count).End(xlUp).Offset(x) = lngNumber
If x = 0 Then x = 1
Next
Next
End Sub
And with notations:
Sub Last()
'declarations: intRow = current row, x = 0 for zero offset initially, and then 1 offset onwards
Dim intRow As Integer
Dim ws1 As Worksheet: Set ws1 = Sheets("Sheet1")
Dim ws2 As Worksheet: Set ws2 = Sheets("Sheet2")
Dim x As Long: x = 0
'for all data in Column A from A1 to last cell in A
For intRow = 1 To ws1.Range("A" & Rows.Count).End(xlUp).Row
'from number in Axx to Bxx
For lngNumber = ws1.Cells(intRow, 1) To CLng(Left(ws1.Cells(intRow, 1), 6) & ws1.Cells(intRow, 2))
'write number in sequence into next blank cell in Sheet2, Column A
ws2.Range("A" & Rows.Count).End(xlUp).Offset(x) = lngNumber
If x = 0 Then x = 1
'next number in sequence
Next
'next row after sequence is exhausted
Next
End Sub
Bookmarks