dianbobo
Messages postés151Date d'inscriptionmardi 20 avril 2010StatutMembreDernière intervention15 juin 2014
-
28 juil. 2010 à 12:25
dianbobo
Messages postés151Date d'inscriptionmardi 20 avril 2010StatutMembreDernière intervention15 juin 2014
-
28 juil. 2010 à 13:45
Bonjour tout le monde
je copie les données dans un classeur et je veux qu'il soit ouvert ,alors je voudrai bien l'ouvrir mais de façon automatique
et j'ai ajouté dans mon code :
Sub recherche_resultat_eco()
Dim i As Long
Dim k As Long
Dim Chemin As String, LaFeuille As String, LeFichier As String
Dim motif As String
Dim wb As Workbook
Dim ws As Worksheet
Set wb = Workbooks("Classeurvarparahist")
Set ws = wb.Worksheets("Feuil1")
LaFeuille = "Historik"
k = ws.Cells(Rows.Count, 4).End(xlUp).Row + 1
motif = "######## - Résultat Economique*"
Chemin = "S:\PGB\DER\_Commun\MBO\RESULTAT ECO suivi quotidien\Résultat économique"
LeFichier = NomPlusJeuneFichierByName(Chemin, motif)
Workbooks.Open Filename:="S:\PGB\DER\_Commun\MBO\ _
RESULTAT ECO suivi quotidien\Résultat économique\LeFichier"
For i = 1 To 28
ws.Cells(k, i).Formula = Workbooks(LeFichier).Worksheets(LaFeuille).Cells(k, i).Value
Next
ActiveWindow.Close
MsgBox NomPlusJeuneFichierByName(Chemin, motif)
End Sub