First, I apologize if my formatting is off; I am not very accustomed to forum use. I am trying to automate a work process and have come to a road block where I need to dynamically create a range based on like values in column A. Basically, I have a large amount of data broken into subsets based on the value in A, and I am trying to find a way to iterate through the column, isolate like values (the column is already sorted), and then merge those rows within column A.
[VBA]Application.DisplayAlerts = False
mergeBottom = Cells(Cells.Rows.Count, "A").End(xlUp).Row
For mergeRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row To 2 Step -1
If Cells(mergeBottom, "A") <> Cells(mergeRow - 1, "A") Then Range(Cells(mergeRow, "A"), Cells(mergeBottom, "A")).Select
mergeBottom = mergeRow - 2
Application.DisplayAlerts = True
The above is what I'm working with so far, and it compiles without error with the rest of my macro, but it doesn't seem to actually do anything. Any advice would be appreciated! I have read on several other advice sites that people tend to discourage merging; this isn't specifically what I'm actually trying to accomplish but is sufficient enough as an explanation to get me heading the right way.