-
Please use the VBA code tags when posting code.
[vba] Do While oRow.Cells(1).Range = oNextRow.Cells(1).Range
If oRow.Cells(1).Range = oNextRow.Cells(1).Range
[/vba]These logically redundant.
DO while X = Y is your Do loop
followed by:
IF X = Y
The Do loop does its thing if X=Y, so an If X=Y is saying the same thing. The do loop only does its thing if X=Y.
I am trying to understand your logic. If RowA(cell1) is the same as RowB(cell1), then make RowB(cell1) = nothing. The logic then moves on to RowB...which is nothing. Now if that nothing = RowC(cell1) - i.e. nothing, then make RowC nothing...also redundant, because it already is.
Can you post an example of the starting conditions (any duplicates) and what you are expecting to be the results?
ASs for the Next error issue. you could do a couple things. You could use a For Each loop, as in for each row, check the next - with a logic check to make sure there IS a Next.
Or you could work backwards, a common thing to do with tables.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules