I am try to format a report so it is simpler to read. Right now I export information from Access. The product names are repetitive and I want to use them as titles, so I want to keep the first title then delete all the similar ones underneath it. Right now my data looks similar to this when exported:
My goal is for it to look like this:
But with my current code I'm getting this:
It skips every other one unless the title changes. I'm so close! Here is my code:
Thanks!
Code:
Apples
Apples
Apples
Apples
Oranges
Oranges
Oranges
Kiwi
Kiwi
Kiwi
Kiwi
Kiwi
Grape
Grape
My goal is for it to look like this:
Code:
Apples
Oranges
Kiwi
Grape
But with my current code I'm getting this:
Code:
Apples
Apples
Oranges
Oranges
Kiwi
Kiwi
Kiwi
Grape
It skips every other one unless the title changes. I'm so close! Here is my code:
Code:
Do Until Cells(myRows, 1) = ""
If Cells(myRows, 1) = Cells(myRows - 1, 1) Then
Cells(myRows, 1).ClearContents
myRows = myRows + 1
End If
myRows = myRows + 1
Loop
Thanks!