Set Mfld = fso.GetFolder(fpath)
For Each Sfld In Mfld.SubFolders
Set fld = fso.GetFolder(Sfld)
ReDim FRef(40, 2)
xc = 0
If PayCode.Exists(Sfld.Name) = True Then
rw = PayCode(Sfld.Name)
PPCount = PayCodeRef(rw, 2)
PayPeriod = PayCodeRef(rw, 6)
Else
MsgBox "Folder Error"
End
End If
NPath = fpath & "\" & Sfld.Name & "\"
For Each fl In fld.Files ' for each filein the folder
xc = xc + 1
FRef(xc, 1) = NPath & fl.Name
FRef(xc, 2) = fl.Name
Next
For rdx = 1 To xc
k1 = 3
If Left(FRef(rdx, 2), 1) = "Q" Then k1 = 2
If Left(FRef(rdx, 2), 1) = "Q" Then k1 = 2
FF = Left(FRef(rdx, 2), k1)
fname = FRef(rdx, 1)
Select Case FF