C
celtic
Guest
Rebonjour a tous...
voilu le pb: il me dit kil y a un problème d'object avec
worbooks.Open (chemin)
??????
Sub OUVRIRFICHIER1()
Dim chemin As String
Dim REF As String
Dim total_heure As Integer
Dim heure As Integer
Dim trouve As Range
Dim P(7) As String
Dim i As Integer
Dim t As Integer
P(1) = Range("B2").Value
P(2) = Range("D2").Value
P(3) = Range("F2").Value
P(4) = Range("H2").Value
P(5) = Range("J2").Value
P(6) = Range("L2").Value
P(7) = Range("N2").Value
For i = 1 To 7
chemin = "C:\Transfer\essai-bilan\" & P(i) & ".xls"
worbooks.Open (chemin)
For t = 1 To 3
With ActiveWorkbook.Sheets(t).Range("B10:H20")
REF = UserForm1.Label9.Caption
Set trouve = .Find(REF)
If Not trouve Is Nothing Then
trouve.Offset(0, 6).Value = heure
total_heure = total_heure + heure
End If
End With
Next t
Next i
End Sub
voilu le pb: il me dit kil y a un problème d'object avec
worbooks.Open (chemin)
??????
Sub OUVRIRFICHIER1()
Dim chemin As String
Dim REF As String
Dim total_heure As Integer
Dim heure As Integer
Dim trouve As Range
Dim P(7) As String
Dim i As Integer
Dim t As Integer
P(1) = Range("B2").Value
P(2) = Range("D2").Value
P(3) = Range("F2").Value
P(4) = Range("H2").Value
P(5) = Range("J2").Value
P(6) = Range("L2").Value
P(7) = Range("N2").Value
For i = 1 To 7
chemin = "C:\Transfer\essai-bilan\" & P(i) & ".xls"
worbooks.Open (chemin)
For t = 1 To 3
With ActiveWorkbook.Sheets(t).Range("B10:H20")
REF = UserForm1.Label9.Caption
Set trouve = .Find(REF)
If Not trouve Is Nothing Then
trouve.Offset(0, 6).Value = heure
total_heure = total_heure + heure
End If
End With
Next t
Next i
End Sub