Afficher un message
Vieux 18/12/2006, 17h13   #2 (permalink)
porcinet82
XLDnaute Barbatruc
 
Avatar de porcinet82
 
Date d'inscription: mars 2005
Localisation: Issy les Moulineaux
Version Excel : Excel 2003 (PC)
Messages: 3 178
Envoyer un message via MSN à porcinet82
Par défaut Re : Parcourir cellule et copier avec condition

Salut,

J'ai pas testé, mais je dirai un truc de genre :

Code:
Sub test()
Dim i&, k&, STRRx As String, STRRx_2 As String
With Sheets("SYNOVR")
    For i = 1 To .Range("AN65536").End(xlUp).Row
        If IsEmpty(.Range("AN" & i).Value) = False Then
            STRRx = .Range("AN" & i).Value
            With Sheets("AFFECTATIONS")
                For k = 1 To .Range("S65536").End(xlUp).Row
                    If .Range("S" & k).Value = STRRx Then
                        STRRx_2 = .Cells(k, 1).Value
                        Exit For
                    End If
                Next k
                With Sheets("SYNOVR")
                    .Range("AN" & i).Value = STRRx_2
                End With
            End With
        End If
    Next i
End With
End Sub
@+
__________________
« Connaître son ignorance est la meilleure part de la connaissance. »
porcinet82 est déconnecté   Réponse avec citation