Bonjour,
Ce bout de code est généré par une macro dans un fichier excel . La zone active se trouve dans une feuille où l'on vient d'importer des données d'un fichier texte.
Le but étant de selectionner une certaine zone d'une colonne en fonction du champ d'une autre colonne.
colonne G = TYPE1
TYPE2
TYPE3
......
TYPE5 (max)
selection dans la colonne A des codes de TYPE1 renvoyé accessible par la combobox.
Dim CurCRASht As Worksheet
Dim CurCRAWkb As Workbook
Dim aCL As Range
Dim pTexte As String
Dim i As Integer
Set CurCRASht = CurCRAWkb.Sheets("Description")
CurCRASht.Select
CurCRASht.Range("G19:G24").Select
i = 1
'probleme de syntaxe pour ce For Each'
For Each CurCRASht.Range("G19:G24") In CurCRASht.Range("G19:G24")
If CurCRASht.Range.value <> "" Then
pTexte = CurCRASht.Range.value
Set aCL = CurCRASht.Cells.Find(What:=pTexte, LookIn:=xlValues, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
CurCRASht.Range("A19:A3000").Select
CurCRASht.Range("A3000").Activate
CurCRAWkb.Names.Add Name:="CdPr" & i & "", RefersToR1C1:="=Description!" & aCL.Rows & "C1:" & aCL.Rows - 1 & "C1"
i = i + 1
End If
Next
Là, je bloque.
Merci d'avance.
Configuration: Windows XP
Firefox 3.0.11