change this basic libre office calc code so that it organize nome congnome e telefono…
- User
change this basic libre office calc code so that it organize nome congnome e telefono for rows instead then for column:
- Assistant
I'm sorry, but without knowing the specific code you are referring to, I'm unable to provide an answer. Please provide the code in question so I can assist you better.
- User
function trovacolonnaLibera(sheet as object) as integer dim nome,cognome,telefono as string dim primacolonnaLibera as integer primacolonnaLibera=0 do primacolonnaLibera = primacolonnaLibera + 1 nome = sheet.getCellByPosition(primacolonnaLibera,0).string cognome = sheet.getCellByPosition(primacolonnaLibera,1).string telefono = sheet.getCellByPosition(primacolonnaLibera,2).string loop while (nome<>"" or cognome<>"" or telefono<>"") trovacolonnaLibera = primacolonnaLibera
- Assistant
To organize "nome", "cognome" and "telefono" for rows instead of columns, you can modify the code as follows:
codefunction trovacolonnaLibera(sheet as object) as integer dim nome, cognome, telefono as string dim primarigalibera as integer primarigalibera = 0 do primarigalibera = primarigalibera + 1 nome = sheet.getCellByPosition(0, primarigalibera).string cognome = sheet.getCellByPosition(1, primarigalibera).string telefono = sheet.getCellByPosition(2, primarigalibera).string loop while (nome<>"" or cognome<>"" or telefono<>"") trovacolonnaLibera = primarigalibera end functionIn this modified code, we are using the "getCellByPosition" method to retrieve data from the three columns (0, 1, and 2 represent the columns for "nome," "cognome," and "telefono," respectively) for each row. Then, we increment the row number instead of the column number until we find a blank row. Finally, we return the number of the first empty row.