I need to search for a folder based on Mgr = Data(I,2)
value and Last = Data(I,1)
value variables. I have all of the folders created in a certain pathway. How would I edit this:
wb.SaveCopyAs ThisWorkbook.Path & Application.PathSeparator & _
ValidFileName(Mgr & "_" & Last & "_General Assessment.xlsx")
so that it searches a folder pathway for the Mgr
variable (manager name) and then the Last
variable (employee name) and then save the file in there? I don't want it to save in the folder pathway that the macro-enabled wb is saved, but to look for the appropriate folder in another pathway.
Rest of code:
For i = 1 To UBound(Data)
If Data(i, 1) <> Last Then
If i > 1 Then
Dest.Select
wb.SaveCopyAs ThisWorkbook.Path & Application.PathSeparator & _
ValidFileName(Mgr & "_" & Last & "_General Assessment.xlsx")
End If
Dest.Resize(, Columns.Count - Dest.Column).EntireColumn.ClearContents
Last = Data(i, 1)
Mgr = Data(i, 2)
j = 0
End If
a = 0
For k = 1 To UBound(Data, 2)
Dest.Offset(a, j) = Data(i, k)
a = a + 1
Next
j = j + 1
Next
SaveCopy wb, Last, Mgr '<< save the last report