Bonjour a tous,
j'ai fait la macro suivante:
en gros, je me positionne en BS3 et je dis à ma macro la condition suivante:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 'Open the directory "S:" to be able to find the correct report With Application.FileDialog(msoFileDialogFilePicker) .InitialFileName = "S:" .Show 'and select the report on which you click If .SelectedItems.Count > 0 Then Workbooks.Open (.SelectedItems(1)) End With str = ActiveWorkbook.Name With ThisWorkbook.Worksheets("S i") For i = 0 To .Columns(.Range("BR3").Column).Find("*", , , , xlByColumns, xlPrevious).Row - 1 If WorksheetFunction.CountIf(Workbooks(str).Worksheets("Donnees").Range("C1:C100"), (.Range("BS3").Offset(i, -69) = "h s")) Then .Range("BS3").Offset(i, 0) = WorksheetFunction.VLookup(.Range("BS3").Offset(i, -70), Workbooks(str).Worksheets("Donnees").Range("C15:C16"), 2, False) / 1000000 Else 'rien End If Next i End With
si en cellule BS3 - 69 il y a marqué h s
alors vlookup de la cellule BS3 -70, ... , ..., false
le code semble s executer correctement mais il n y a pas de reponse, sauriez vous ou est le souci?
merci pour votre aide,
Bien cordialement
Partager