

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
16 messages in org.openoffice.fr.progRe: [prog] Nom de variable dynamique| From | Sent On | Attachments |
|---|---|---|
| Michel Grentzinger | Nov 7, 2007 4:39 am | |
| Bernard Marcelly | Nov 7, 2007 5:19 am | |
| Michel Grentzinger | Nov 7, 2007 5:43 am | |
| Mathias Michel | Nov 7, 2007 7:26 am | |
| Bob | Nov 7, 2007 9:48 am | |
| Michel Grentzinger | Nov 7, 2007 1:16 pm | |
| Michel Grentzinger | Nov 7, 2007 1:19 pm | |
| Mathias Michel | Nov 7, 2007 2:28 pm | |
| Michel Grentzinger | Nov 8, 2007 12:17 am | |
| Bob | Nov 8, 2007 1:29 am | |
| Laurent Godard | Nov 8, 2007 1:41 am | |
| Michel Grentzinger | Nov 8, 2007 4:45 am | |
| Bob | Nov 8, 2007 11:59 am | |
| Michel Grentzinger | Nov 8, 2007 1:06 pm | |
| Bob | Nov 8, 2007 2:23 pm | |
| Michel Grentzinger | Nov 9, 2007 4:48 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [prog] Nom de variable dynamique | Actions... |
|---|---|---|
| From: | Michel Grentzinger (mic....@online.fr) | |
| Date: | Nov 7, 2007 1:19:04 pm | |
| List: | org.openoffice.fr.prog | |
Le mercredi 7 novembre 2007 18:49, Bob a écrit :
Pourquoi ne pas utiliser les fonctions de Calc ? RECHERCHEH devrait faire l'affaire.
=RECHERCHEH(La_zone_du_tableau; adresse_de_la_cellule_contenant_le nom_de_colonne; adresse_de_la_cellule_contenant_le_numero_de_ligne; 0)
Ah... Je n'y avais pas pensé... Je vais regarder dans mon bouquin de quelle façon, je peux transmettre la valeur de retour d'une fonction Calc à une fonction Basic.
ensuite, ta macro modifie simplement les cellules contenant le nom de la colonne et le numéro de ligne et tu récupère le résultat de la formule =RECHERCHEV(...)
---------------------------------------------------------------------------
---
Autre solution par macro : la recherche est assez bestiale. Je voulais améliorer tout ça en conservant le résultat de la première recherche dans un cache, ce qui devrait booster les performances.
cacheMnemo as string dim cacheNumColForMnemo(100) as integer
Function ColNumForMnemo(aMnemo as string) as integer dim colNum as integer dim rowNum as integer dim colName as string dim findCol as boolean
colNum = 0 rowNum = 0 ' numero de la ligne contenant les entetes findCol = false with TheSheet do until .getCellByPosition(colNum, rowNum).string = "" colName = .getCellByPosition(colNum, rowNum).string if colName = aMnemo then findCol = true exit do end if colNum = colNum + 1 loop end with
if findCol then ColNumForMnemo() = colNum else ColNumForMnemo() = -1 end if
End Function
C'est une fonction qui permet de rechercher quelle est la colonne contenant l'en-tête mais je souhaite éviter de devoir passer par ceci car j'ai beaucoup de données et je crains pour la rapidité...
-- Michel Grentzinger OpenPGP key ID : B2BAFAFA Available on http://www.keyserver.net







