jabawalkie5000
New Member
- Joined
- Jun 13, 2011
- Messages
- 41
Hi All
I am trying to get this code to open up several documents stored in a sheet called "tab"
It doesnt work, can you spot the problem?
Thanks
Sub openFiles2()
Dim strpath As String
Dim rngFileNames As Range: Set rngFileNames = ActiveSheet.Range("A2", Cells(Rows.Count, "a").End(xlUp))
Dim FileNameCell As Range
Application.ScreenUpdating = False
strpath = "F:\J\Procurement\Change Management\Del\"
For Each FileNameCell In rngFileNames
If Not IsEmpty(FileNameCell) Then Workbooks.Open strpath & FileNameCell.Value
Next FileNameCell
Application.ScreenUpdating = False
End Sub
I am trying to get this code to open up several documents stored in a sheet called "tab"
It doesnt work, can you spot the problem?
Thanks
Sub openFiles2()
Dim strpath As String
Dim rngFileNames As Range: Set rngFileNames = ActiveSheet.Range("A2", Cells(Rows.Count, "a").End(xlUp))
Dim FileNameCell As Range
Application.ScreenUpdating = False
strpath = "F:\J\Procurement\Change Management\Del\"
For Each FileNameCell In rngFileNames
If Not IsEmpty(FileNameCell) Then Workbooks.Open strpath & FileNameCell.Value
Next FileNameCell
Application.ScreenUpdating = False
End Sub