Hi,
I used an existing macro that should be working but it doesn't anymore neither does the one below.
I know the second part is probably incorrect, but the first one is from the existing code so it should be working fine.
What is the problem?
Thanks for reading!
I used an existing macro that should be working but it doesn't anymore neither does the one below.
Code:
Dim x As Integer
Dim i As Integer
x = 1
For i = 0 To 15
Range("c4").Value = (x + i)
Sheets("feuil1").Select
PathName = Range("D3").Value
Filename = Range("D4").Value
TabName = Range("D5").Value
ControlFile = ActiveWorkbook.Name
Workbooks.Open Filename:=PathName & Filename
ActiveSheet.Name = TabName
Sheets(TabName).Copy After:=Workbooks(ControlFile).Sheets(1)
Windows(Filename).Activate
ActiveWorkbook.Close SaveChanges:=False
Windows(ControlFile).Activate
Sheets("feuil1").Select
TabName2 = Range("D6").Value
Workbooks.Open Filename:=PathName & Filename
ActiveSheet.Name = TabName2
Sheets(TabName2).Copy After:=Workbooks(ControlFile).Sheets(1)
Windows(Filename).Activate
ActiveWorkbook.Close SaveChanges:=False
Windows(ControlFile).Activate
Sheets("feuil1").Select
Next i
Range("c4").Value = 0
End Sub
I know the second part is probably incorrect, but the first one is from the existing code so it should be working fine.
What is the problem?
Thanks for reading!
Last edited by a moderator: