Sorting rows by identical value of columns

F

fredrikson

I have an inventory worksheet with 3 columns. Each of the columns
contains values that should exist in at least one of the other two
columns. We want to visualize the rows that contains values not
represented in another column.

The data in each column is sorted A-Z, but this does not show the
"gaps" where a value is not in one of the other columns.

A B C
1 PC1 PC2 PC2
2 PC2 PC3 PC4
3 PC3 PC4 PC5
4 PC5 PC5 PC6


We want this sorted by identical values on the "row axis".

A B C
1 PC1
2 PC2 PC2 PC2
3 PC3 PC3
4 PC4 PC4
5 PC5 PC5 PC5
6 PC6

Any help appreciated :)
 
D

Don Guillett

You may have solved it yourself with your helper column to the left. If your
data is as shown with the number at the end you could have a macro create a
helper column and sort by that. It would depend on the actual layout and the
actual numbers.
 
D

Don Guillett

Sub restructure()
Dim rn As Integer
Dim mn As Integer
For Each c In Range("b1:d4")
mn = Right(c, 1)
rn = c.Row
If mn <> rn Then c.Insert shift:=xlDown
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top