I'm taking the files in one directory and placing the ones I need in a string. Next, I need to open those files, and I need the users to be able to see which files are opened. Using the code below, I place them in the cells starting in cell A2 and going down. The cells have the whole file path and name in them. How would I take that and open each of those files?
Dim fso, Folder, FileList, File, SearchChar, i
'Search String for this word or phrase, so file will be skipped
SearchChar = Trim(Range("J1").Value)
Set fso = CreateObject("Scripting.FileSystemObject")
'Set to appropriate folder by selecting the cell address
'for example if the address is stored in cell D5
Set Folder = fso.GetFolder(Trim(Range("A2").Value))
Set FileList = Folder.Files
'i=3 will ensure that the data will start pasting from 3rd Row
i = 3
For Each File In FileList
'if Instr is 0 that means the file doesn't have the word
'package in it
If InStr(File.Name, SearchChar) = 0 Then
'"A" will ensure that the data will start pasting from Column A
Range("A" & i).Value = File.Name
i = i + 1
End If
Next File