1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| Dim xlApp As Excel.Application
Dim xlSheet As Excel.Worksheet
Dim xlBook As Excel.Workbook
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = False
'Selection du fichier
Set xlBook = xlApp.Workbooks.Open(fileName)
'Selection de la feuille PROMO
Set xlSheet = xlBook.Worksheets("PROMO")
' Parcours des lignes
Dim line As Long
Dim nbLine As Long
line = 8
nbLine = xlSheet.Range("A65536").End(xlUp).Row
Do While line <= nbLine
MsgBox xlSheet.Cells(line, 10) & " - " & line
line = line + 1
Loop
xlApp.Quit
Set xlSheet = Nothing
Set xlBook = Nothing
Set xlApp = Nothing |