😕
Bonsoir a tous,
Si quelqu'un peu m'apporter de l'aide sur cette programmation
Je vous l'ai joint ci dessous elle fonctionne
Elle va dans un dossier ouvrir un a un des fichiers XLS copier une partie de cellule et les coller dans mon fichier TONY sur la feuille TARIFAIRE
En faite je souhaiterai modifier la programmation c'est a dire remplacer le chemin d'acces au dossier ("C:\Documents and Settings\FRNTO2M\Bureau\TEST\*.xls") par sheets("TARIFAIRE") range ("A1") afin qu'elle aille chercher son chemin dans la celulle A1 de la feuille TARIFIARE.
d'avance merci de votre aide
code:
Sub EXPORT()
Application.ScreenUpdating = False
R = MsgBox("Vous voulez importer les Relevés de Prix ? ", vbYesNo + vbQuestion, "EXTRACTION DES RELEVES")
If R = vbYes Then
With ActiveWorkbook
.Sheets("TARIFAIRE").Unprotect
End With
Dim W As String
i = 9
W = Dir("C:\Documents and Settings\FRNTO2M\Bureau\TEST\*.xls")
Do Until W = ""
i = i + 1
Workbooks.Open Filename:="C:\Documents and Settings\FRNTO2M\Bureau\TEST\" & W
If i = 110 Or i = 112 Then i = i + 2
Worksheets(1).Unprotect ("AZERTY")
'or boeuf
ActiveWorkbook.Sheets(1).Range("c3:c5").Select
Selection.Copy
Application.Windows("TONY.xls").Activate
Cells(5, i).Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Cells(5, i).Validation.Delete
Cells(6, i).Validation.Delete
Cells(7, i).Validation.Delete
Windows(2).Activate
Application.CutCopyMode = False
'le magasin
Range("d5:d6").Select
Selection.Copy
Application.Windows("TONY.xls").Activate
Cells(9, i).Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Cells(9, i).Validation.Delete
Cells(10, i).Validation.Delete
Windows(2).Activate
Application.CutCopyMode = False
Worksheets(1).Protect ("AZERTY")
Application.Windows(1).Activate
ActiveWorkbook.Close savechanges:=False
W = Dir
Loop
End If
Sheets("TARIFAIRE").Select
Application.ScreenUpdating = True
End Sub
Bonsoir a tous,
Si quelqu'un peu m'apporter de l'aide sur cette programmation
Je vous l'ai joint ci dessous elle fonctionne
Elle va dans un dossier ouvrir un a un des fichiers XLS copier une partie de cellule et les coller dans mon fichier TONY sur la feuille TARIFAIRE
En faite je souhaiterai modifier la programmation c'est a dire remplacer le chemin d'acces au dossier ("C:\Documents and Settings\FRNTO2M\Bureau\TEST\*.xls") par sheets("TARIFAIRE") range ("A1") afin qu'elle aille chercher son chemin dans la celulle A1 de la feuille TARIFIARE.
d'avance merci de votre aide
code:
Code:
Sub EXPORT()
Application.ScreenUpdating = False
R = MsgBox("Vous voulez importer les Relevés de Prix ? ", vbYesNo + vbQuestion, "EXTRACTION DES RELEVES")
If R = vbYes Then
With ActiveWorkbook
.Sheets("TARIFAIRE").Unprotect
End With
Dim W As String
i = 9
W = Dir("C:\Documents and Settings\FRNTO2M\Bureau\TEST\*.xls")
Do Until W = ""
i = i + 1
Workbooks.Open Filename:="C:\Documents and Settings\FRNTO2M\Bureau\TEST\" & W
If i = 110 Or i = 112 Then i = i + 2
Worksheets(1).Unprotect ("AZERTY")
'or boeuf
ActiveWorkbook.Sheets(1).Range("c3:c5").Select
Selection.Copy
Application.Windows("TONY.xls").Activate
Cells(5, i).Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Cells(5, i).Validation.Delete
Cells(6, i).Validation.Delete
Cells(7, i).Validation.Delete
Windows(2).Activate
Application.CutCopyMode = False
'le magasin
Range("d5:d6").Select
Selection.Copy
Application.Windows("TONY.xls").Activate
Cells(9, i).Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Cells(9, i).Validation.Delete
Cells(10, i).Validation.Delete
Windows(2).Activate
Application.CutCopyMode = False
Worksheets(1).Protect ("AZERTY")
Application.Windows(1).Activate
ActiveWorkbook.Close savechanges:=False
W = Dir
Loop
End If
Sheets("TARIFAIRE").Select
Application.ScreenUpdating = True
End Sub
Code: