I want to iterate over a range of cells in alphabetical order to create a report in alphabetical order. I do not want to sort the sheet, since the original order is important.
Sub AlphaLoop() 'This is showing N and Z in uppercase, why? For Each FirstLetter In Array(a, b, c, d, e, f, g, h, i, j, k, l, m, N, o, p, q, r, s, t, u, v, w, x, y, Z) For Each SecondLetter In Array(a, b, c, d, e, f, g, h, i, j, k, l, m, N, o, p, q, r, s, t, u, v, w, x, y, Z) For Each tCell In Range("I5:I" & Range("I20000").End(xlUp).Row) If Left(tCell, 2) = FirstLetter & SecondLetter Then 'Do the report items here End If Next Next Next End Sub
Please note that this code has not been tested, it is sorted by the first two letters only and takes a lot of time, since it has to scroll through the text 676 times. Is there a better way than this?