Could someone help me get this macro to work for Mac Microsoft 365?
Sub Makro1()
Application.ScreenUpdating = False
DestBook = ActiveWorkbook.Name
Files = Application.GetOpenFilename(FileFilter:="Excel files (*.xls*), *.xls*", Title:="Choose an Excel file to open", MultiSelect:=True)
If Not IsArray(Files) Then
Exit Sub
End If
For Each File In Files
Col = 4
Workbooks.Open (File)
SourceBook = ActiveWorkbook.Name
DoWhile = True
Do While DoWhile = True
Windows(DestBook).Activate
Sheets(1).Cells(1, Col).Select
If Selection.Text = "" Then
EndRow = 1
StartRow = 1
Else
Range(Selection, Selection.End(xlDown)).Select
EndRow = Selection.Rows.Count + 1
StartRow = 2
End If
' Do col3 vlozi nazov suboru
If Col = 4 Then
ActiveSheet.Cells(EndRow, 3).Value = SourceBook
End If
Windows(SourceBook).Activate
ActiveSheet.Cells(StartRow, Col).Select
If Selection.Text = "" Then
Exit Do
End If
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows(DestBook).Activate
ActiveSheet.Cells(EndRow, Col).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteColumnWidths
Col = Col + 1
Loop
Windows(SourceBook).Close
Application.ScreenUpdating = True
Windows(DestBook).Activate
Next
Application.ScreenUpdating = True
End Sub