After some tweaks, here's the final code. Thanks again dolswang!!!
Sub PrepareEOY()
Dim pathstr, strfile As String
Dim a, b, c, d, e As Integer
Application.ScreenUpdating = False
pathstr = ""
strfile = ""
pathstr = "Full directory path to folder"
ChDir (pathstr)
strfile = Dir("*.xls")
Range("A3").Select
Do While Len(strfile) > 0
Workbooks.Open (pathstr & "\" & strfile)
If Range("'Sheet Name'!F10").Value = "RATE" Or Range("'Sheet
Name'!F10").Value = "Rate" Then ' To determine between two sheet types.
a = Range("'Sheet Name'!G38").Value ' change it to needed cell address
b = Range("'Sheet Name'!G39").Value ' change it to needed cell address
c = Range("'Sheet Name'!I38").Value ' change it to needed cell address
d = Range("'Sheet Name'!J38").Value ' change it to needed cell address
e = Range("'Sheet Name'!K38").Value ' change it to needed cell address
Else
a = Range("'Sheet Name'!G39").Value ' change it to needed cell address
b = Range("'Sheet Name'!G40").Value ' change it to needed cell address
c = Range("'Sheet Name'!I39").Value ' change it to needed cell address
d = Range("'Sheet Name'!J39").Value ' change it to needed cell address
e = Range("'Sheet Name'!K39").Value ' change it to needed cell address
End If
Workbooks(strfile).Close
Application.Selection.Offset(0, 1).Value = a
Application.Selection.Offset(0, 2).Value = b
Application.Selection.Offset(0, 3).Value = c
Application.Selection.Offset(0, 4).Value = d
Application.Selection.Offset(0, 5).Value = e
Application.Selection.Offset(0, 6).Value = strfile
Application.ActiveCell.Offset(1, 0).Select
ChDir (pathstr)
strfile = Dir
Loop
' AutoSum for total line
Application.Selection.Offset(0, 1).Select
AutoSum
Application.Selection.Offset(0, 1).Select
AutoSum
Application.Selection.Offset(0, 1).Select
AutoSum
Application.Selection.Offset(0, 1).Select
AutoSum
Application.Selection.Offset(0, 1).Select
AutoSum
Application.ActiveCell.Offset(1, 0).Select
Application.ScreenUpdating = True
End Sub
Sub AutoSum()
Dim cel1, cel2
ActiveCell.Offset(-1, 0).Select
cel1 = Selection.End(xlUp).Address
cel2 = ActiveCell.Address
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = "=sum(" & (cel1) & ":" & (cel2) & ")"
End Sub