Change rows to columns

I have a WebListBox data, how can I do to pass the rows of the WebListBox to another WebListBox as columns?
Here an Image

Loop through ListBox1’s rows and add them as columns to ListBox2.

Thanks, but how do I add columns with those values?

Its My Code

And run for one time.

Dim i As Integer For i = 0 to REP_LISTA.RowCount -1 Dim RS As RecordSet RS=Android.SQLSelect("SELECT extintor_param_desc FROM c_extintor_param WHERE empresa=3 AND extintor_param='"+Trim(REP_LISTA.Cell(i,0))+"'") DATOS_PARAMETROS.Cell(DATOS_PARAMETROS.LastIndex, i)=RS.Field("extintor_param_desc").StringValue Next RS.Close

I’m not sure if it’ll be any help, but I wrote this routine years ago to transpose the tab-delimited text from a ListBox. There may be a faster and better way, but this works.

[code]Function getTransposeRowsAndColumns(rowsAndColumns As String) As String
Dim tempInt, tempInt2, tempInt3, tempInt4 As Integer 'columnCount
Dim tempReturn, tempString, tempLine As String = “”

rowsAndColumns = ReplaceLineEndings(rowsAndColumns, EndOfLine)

'saves a lot of wasted time if it is blank
if rowsAndColumns = “” then Return “”

'If there is only one row then turns tabs to returns, speeds things up
if instr(0, rowsAndColumns, EndOfLine) = 0 then Return ReplaceAll(rowsAndColumns, chr(9), EndOfLine)

tempInt2 = common.getTextColumnCount(rowsAndColumns)
tempInt4 = CountFields(rowsAndColumns, EndOfLine)
for tempInt = 1 to tempInt2
tempLine = “”
for tempInt3 = 1 to tempInt4
tempString = NthField(rowsAndColumns, EndOfLine, tempInt3)
tempLine = tempLine + chr(9) + NthField(tempString, chr(9), tempInt)
next
if left(tempLine, 1) = chr(9) then tempLine = mid(tempLine, 2) 'remove the leading tab
tempReturn = tempReturn + tempLine + EndOfLine
next
if right(tempReturn, len(EndOfLine)) = EndOfLine then tempReturn = left(tempReturn, len(tempReturn) - len(EndOfLine)) 'Remove the trailing return

’ tempReturn = commonWE.getRemove(tempReturn, “Trailing”, “Tabs”)

Return tempReturn

’ Exception err
’ if not commonWE.getHandleException(err, "Method: " + CurrentMethodName) then Raise err

End Function
[/code]

Thanks David, But how do I implement in my code?

You loop around adding the contents of the WebListBox into a string, send the string to my method, clear the WebListBox, then loop around adding the new string values back into the WebListBox.

Do not quite understand, my native language is not English. You have some more practical example? :frowning:

¿ El Español canal seria mas facil para usted ?

My method turns:

A B C
D E F
G H I
J K L
M N O
i.e.
A B C
D E F
G H I
J K L
M N O

into:

A D G J M
B E H K N
C F I L O

If this is useful then please use it.

Thanks the method not run.

Santiago,

You will need to provide more details of what is not working and what you have tried for others to try to help.

As Michel proposed, if you feel the language is a barrier for the communication we can switch to the Spanish channel, and I will be happy to try to help.

Julen