re,
je ne sais pas si ce double point après then (then:) cause des problèmes ?? mais peut-être la différence entre majuscules et minuscules n'est pas important ??? Don c oubien "Option Compare Text" comme première ligne de ce module oubien "StrComp(string1,string2,1)=0"
Dim cell As Range
Dim cell1 As Range
For Each cell In Worksheets("Base").Range("F3:F1450").Cells
If cell.Value <> "" Then:
For Each cell1 In Worksheets("Extraction").Range("B2:B1450").Cells
If cell.Value = cell1.Value Then
If StrComp(Worksheets("Extraction").Cells(cell1.Row, 5).Value, "STKDIV", 1) = 0 Then
Worksheets("Base").Cells(cell.Row, 8).Value = Worksheets("Extraction").Cells(cell1.Row, 15).Value
End If
End If
Next cell1
Next cell
aussi facile à utiliser :
Worksheets("Extraction").Cells(cell1.Row, 5).Value est la même chose que cell1.offset(,5-cell1.column).value, donc
If StrComp(cell1.Offset(, 5 - cell1.Column).Value, "STKDIV", 1) = 0 Then
cell.Offset(, 8 - cell.Column).Value = cell1.Offset(, 15 - cell1.Column).Value