j'ai trouvé dans la faq, la ligne de code suivante
vtemp = xlSheet.Columns("E").Find("sdklmjflskdjklfjklsdjfksdfj").Row
Seulement quand la valeur recherché n'existe pas dans la colonne j'ai une erreur variable objet ou varable de bloc with non définie.
Voici tout le code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| 'Ouvrir le fichier excel
Dim xlApp As Excel.Application
Dim xlSheet As Excel.Worksheet
Dim xlBook As Excel.Workbook
Dim vtemp As Variant
'J'initialise mes variables + ouverture du fichier
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("T:\EF ESES RGV\ESES RGV R4 Settlement Custody\11.Perso\DMO\temp\Matching_fonctionnel_technique v0.1.xls")
Set xlSheet = xlBook.Sheets("Gérer Pouvoir Achat Position ")
MsgBox xlSheet.Cells(1, 1)
'Touver une valeur dans une colonne
vtemp = xlSheet.Columns("E").Find("sdklmjflskdjklfjklsdjfksdfj").Row |
Si vous pouvez m'aider, je vous en remercie
Partager