Hello everyone,
I have a problem with my macro. It always stop on this point (red color):
Function AddTabInformation(ByRef Sheetnames() As String, ByRef SheetCount As Integer)
For Iteration = 2 To 8
Workbooks.Open (ActiveWorkbook.Path & "\RAW\" + Sheetnames(Iteration))
If Iteration = 2 Then
Call x2
ElseIf Iteration = 3 Then
Call x3
ElseIf Iteration = 4 Then
Call x4
ElseIf Iteration = 5 Then
Call x5
ElseIf Iteration = 6 Then
Call x6
ElseIf Iteration = 7 Then
Call x7
Else
Call x8
End If
Call AddXRowInformation(Sheetnames, Iteration)
Next
Sheets(1).Select
End Function
How the Code works
It gets an Array with the Name of the Sheets (Example below) and use it to open it via the function Workbooks.Open, then it will call a function, where the things inside the report will be formatted.
Sheetnames(0) = "DASHBOARD - Copy.xlsb"
Sheetnames(1) = "x1.xlsx"
Sheetnames(2) = "x2.xls"
Sheetnames(3) = "x3.xls"
Sheetnames(4) = "x4.xls"
Sheetnames(5) = "x5.xls"
Sheetnames(6) = "x6.xls"
Sheetnames(7) = "x7.xls"
Sheetnames(8) = "x8.XLSX"
Error description:
2019-10-09_7-52-49.png
Bookmarks