fonction find qui merdoie ?

  • Initiateur de la discussion Initiateur de la discussion grodep
  • Date de début Date de début

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

grodep

XLDnaute Occasionnel
Re re bonjour
Décidément je publie bcp aujourd'hui...
bon dans le code qui suit je ne comprends pas la valeur que ma fonction renvoie, je suis sur qu'il s'agit d'un truc tout bete, mais je dois etre encore plus bete que ça 🙁
voici le bout de code incriminé :

Code:
Sheets("Feuil3").Range("A1:I65536").ClearContents
Sheets("Feuil3").Range("A1:I65536").ClearFormats
For n = 8 To 100
Strcol = IIf((n - 1) \ 26 > 0, Chr((n - 1) \ 26 + 64), "")
Strcol = Strcol & Chr(n - ((n - 1) \ 26) * 26 + 64)
If Sheets("prévi").Range(Strcol & "3").Value <> "" And Sheets("prévi").Range(Strcol & "3").Value <> "météo" Then
ch = Sheets("prévi").Range(Strcol & "3").Value
ch = Left(ch, 2)
Set l = Sheets("Feuil3").Rows(1).Find(ch, LookIn:=xlValues, lookat:=xlWhole)
If Not l Is Nothing Then
    colonne = l.Column
    MsgBox colonne
et colonne prend la valeur 16385 alors que "Feuil3" est intégralement vierge puisque nettoyer en début de code.

Là j'avoue, je sèche.
merci d'avance
 
Re : fonction find qui merdoie ?

ben en fait ça merdoie pas du tout , c'était moi : il fallait mettre xlToLeft et non pas xlToRight.
de plus je me rends compte que je n'avais pas mis le bout de code qui mouise ... comme ça personne pouvait trouver la solution.
a vouloir faire trop vite...

le code en question

Code:
Sheets("Feuil3").Range("A1:I65536").ClearContents
Sheets("Feuil3").Range("A1:I65536").ClearFormats
For n = 8 To 100
Strcol = IIf((n - 1) \ 26 > 0, Chr((n - 1) \ 26 + 64), "")
Strcol = Strcol & Chr(n - ((n - 1) \ 26) * 26 + 64)
If Sheets("prévi").Range(Strcol & "3").Value <> "" And Sheets("prévi").Range(Strcol & "3").Value <> "météo" Then
ch = Sheets("prévi").Range(Strcol & "3").Value
ch = Left(ch, 2)
Set l = Sheets("Feuil3").Rows(1).Find(ch, LookIn:=xlValues, lookat:=xlWhole)
If Not l Is Nothing Then
    colonne = l.Column
    
Else
    If Sheets("top").Range("A1").End(xlToLeft).Column < 3 Then
        colonne = 3
    Else
        colonne = Sheets("top").Range("A1").End(xlToLeft).Column + 1
    End If
MsgBox colonne
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
7
Affichages
371
D
Réponses
4
Affichages
1 K
Réponses
2
Affichages
1 K
  • Question Question
Microsoft 365 Programme trop lent
Réponses
12
Affichages
1 K
M
Réponses
2
Affichages
1 K
Retour