Try the following. You should loop backwards through the messages as shown or the process can lose track of the count when the messages are moved.
Public Sub loop_test()
Dim i As Long
Dim objNS As NameSpace
Dim objInbox As Folder
Dim objFolder As Folder
Dim subFolder As Folder
Dim olMail As MailItem
Set objNS = GetNamespace("MAPI")
Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
Set objFolder = objNS.GetDefaultFolder(olFolderInbox).folders("Opportunities").folders("Customers")
For i = objInbox.items.Count To 1 Step -1
If TypeName(objInbox.items(i)) = "MailItem" Then
Set olMail = objInbox.items(i)
For Each subFolder In objFolder.folders
If InStr(olMail.Subject, subFolder.Name) Then
olMail.Move subFolder
Exit For
End If
DoEvents
Next subFolder
End If
DoEvents
Next i
Set objNS = Nothing
Set objInbox = Nothing
Set olMail = Nothing
Set objFolder = Nothing
Set subFolder = Nothing
End Sub