If I want to open - let's say - five different text files (this can be more than five though) by using the method to select multiple files, how do you open them all as different workbooks and let the system ask you to save the workbook as the name of the file. Below I have a function to make new workbooks with one sheet.
[vba]Private Sub NewWB()
Set wb = NewWorkbook(1)
End Sub
Function NewWorkbook(wsCount As Integer) As Workbook
Dim OriginalWorksheetCount As Long
Set NewWorkbook = Nothing
If wsCount < 1 Or wsCount > 255 Then Exit Function
OriginalWorksheetCount = Application.SheetsInNewWorkbook
Application.SheetsInNewWorkbook = wsCount
Set NewWorkbook = Workbooks.Add
Application.SheetsInNewWorkbook = OriginalWorksheetCount
End Function[/vba]
Within each workbook there is a macro running before he wants to save it, but that macro is already working. I'll add stuff later on, but I want to try saving them first because I am constantly testing in the same workbook.
So it goes like this:
select files -> open new workbook -> run macro I already have -> save workbook as name of the opened file -> go to next new workbook with the second file from the list -> repeat the same process until all files are saved as their own name (workbook).
I was thinking of a 'for each' loop to read the files and let the workbook be added by the system in steps.