Hi, this macro is used to group files in a folder. It created a sub folder in the main folder but I now need it to create the folder in a different location. I've tried doing this myself but having difficulty. Can someone please point me in the correct direction?
Thank you
Sub FindFilesAndMove()
Dim MyFolder As String, MyFile As String, srchStr As String, DestFold As String, FSO As Object, rCell As Range
Set FSO = CreateObject("Scripting.Filesystemobject")
MyFolder = "Y:\accounts\Conv slips" '<<< change to suit
For Each rCell In Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row).Cells
MyFile = Dir(MyFolder)
srchStr = rCell.Value
DestFold = MyFolder & srchStr & ""
MkDir DestFold
Do While MyFile <> ""
If InStr(MyFile, srchStr) Then
FSO.MoveFile Source:=MyFolder & MyFile, Destination:=DestFold & MyFile
End If
MyFile = Dir
Loop
Next rCell
End Sub