Private Sub CommandButton2_Click()
Dim Repert As String
Dim NomRepertoire As String
Dim Racine As String
Dim Wbk1 As Workbook, Wbk2 As Workbook
Racine = "C:\Documents and Settings\ba\Bureau\laboratoire excel\Stockage virtuel\"
NomRepertoire = "20" & Right(Worksheets(2).Cells(11, 7), 2) & Mid(Worksheets(2).Cells(11, 7), 4, 2) & Mid(Worksheets(2).Cells(11, 7), 1, 2) & Worksheets(2).Cells(14, 7).Text & "\"
Call CopyFolder("C:\Documents and Settings\ba\Bureau\laboratoire excel\CD type", Racine)
Name "C:\Documents and Settings\ba\Bureau\laboratoire excel\Stockage virtuel\CD type" As "C:\Documents and Settings\ba\Bureau\laboratoire excel\Stockage virtuel\" & NomRepertoire
Set Wbk1 = ThisWorkbook
Set Wbk2 = Workbooks.Open(FileName:="C:\Documents and Settings\ba\Bureau\laboratoire excel\Stockage virtuel\" & NomRepertoire & "DEMANDE_CEE.xls" )
Wbk2.Worksheets(7).Range(Cells(11, 7), Cells(19, 7)).Value = Wbk1.Worksheets(2).Range(Cells(11, 7), Cells_(19,7)).Value
a = MsgBox("Le dossier a bien été archivé", vbOKOnly)
End Sub
|