# adding rows into a listview

Dear all
I'm having a problem reorganizing the values from one list o convert rows to columns
the extraction from a previous listview  (lrest) is ok , but when the values are added in the other listview (Listnf) it is sorted in no consecutive rows however the columns are Ok
For j = 1 To nnod
For i = 1 To 6 ' ////6 DOF rotation
If lrest.ListItems.Item(j).SubItems(i) = 1 Then
neq = Matrices.neq + 1
Else
End If
Next i
Next j

example for the  listview Listnf
1
2
3
1
2
3
1
2
3
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Older than dirtCommented:
Please show me picture of the source listview and a picture of what you want the output to be. If you can't do pictures then simulate them in an Excel workbook using rows an columns.
Author Commented:
Thanks Martin

Author Commented:
I edited the result in Paint just to show what I want to get
try this:

``````Dim x As ListItem
For j = 1 To lrest.ColumnHeaders.Count - 1
Set x = Matrices.Listnf.ListItems.Add(Matrices.Listnf.ListItems.Count + 1, , "")
For i = 1 To Listnf.ColumnHeaders.Count - 1
If lrest.ListItems(i).SubItems(j) = 1 Then
Matrices.neq = Matrices.neq + 1
Else
End If
Next i
Next j
``````

Experts Exchange Solution brought to you by