Hello I am new to VBA. I am a nurse so I don't know most of the proper jargons to use so please bear with me.

I am currently working on a macro that will extract all encoded information from all files in the specified folder to my mastersheet.
The code I made was successful. However, I noticed that when my folder is located to D:\, all newly added files in my folder were not extracted unless if I move the folder to another directory (e.g. to C:\). But if I place the folder in C:\ directory and add new files, it works perfectly. Here is my code so you may help me.

PS: May I also ask if anyone can give me a code to rename the files that I already extracted? Just to append the word "Extracted" after their file names (e.g. from PHP.Jeff.xlsm -> PHP.Jeff(Extracted).xlsm).

TYIA.


Sub LoopThroughDirectory()

Dim ws As Worksheet
Dim eRow As Long
Dim MyFile As String
Dim Filepath As String
Set ws = Worksheets("ROMasterlist")
Filepath = Range("FileLocation").Value


MyFile = Dir(Filepath)
Do While Len(MyFile) > 0
    If MyFile = Range("FileName") Then
    Exit Sub
    End If
   
    Workbooks.Open (Filepath & MyFile)
    Range("RAW").Copy
    Application.DisplayAlerts = False
    ActiveWorkbook.Close
   
    ws.Select
    eRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _
    SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
    Cells(eRow, 1).Select
    ActiveSheet.Paste
    
    MyFile = Dir

Loop
End Sub