Macro for sequential numbering
I didn't know what you wanted to do with the new codes.
If you want to collect them in columns, then do the
following replacements:
Replace: str1 = Sheets("Sheet1").Range("A1")
with: iRow = Sheets("Sheet1").Range("A1").End(xlDown).Row
str1 = Sheets("Sheet1").Range("A" & iRow)
Replace: str1 = Sheets("Sheet1").Range("B1")
with: iRow = Sheets("Sheet1").Range("B1").End(xlDown).Row
str1 = Sheets("Sheet1").Range("B" & iRow)
Replace: Sheets("Sheet1").Cells(1, iCol) = str1
With: Sheets("Sheet1").Cells(iRow + 1, iCol) = str1
Hth,
Merjet
|