title: How can I move Mails Items from Outlook Inbox with specific subject to specific folder/sub folder?
body: <p>My mails in Outlook has all specific subjects. I have a Excel Sheet which has subject and Folder Name. </p>
  
  <p>I have already this code from <a href="https://stackoverflow.com/a/29910853/4539709">Stackoverflow</a> </p>
  
  <pre><code>Option Explicit
  Public Sub Move_Items()
      '// Declare your Variables
      Dim Inbox As Outlook.MAPIFolder
      Dim SubFolder As Outlook.MAPIFolder
      Dim olNs As Outlook.NameSpace
      Dim Item As Object
      Dim lngCount As Long
      Dim Items As Outlook.Items
  
      On Error GoTo MsgErr
      '// Set Inbox Reference
      Set olNs = Application.GetNamespace("MAPI")
      Set Inbox = olNs.GetDefaultFolder(olFolderInbox)
      Set Items = Inbox.Items
  
      '// Loop through the Items in the folder backwards
      For lngCount = Items.Count To 1 Step -1
          Set Item = Items.Item(lngCount)
  
          Debug.Print Item.Subject
  
          If Item.Class = olMail Then
              '// Set SubFolder of Inbox
              Set SubFolder = Inbox.Folders("Temp")
              '// Mark As Read
              Item.UnRead = False
              '// Move Mail Item to sub Folder
              Item.Move SubFolder
          End If
      Next lngCount
  
  MsgErr_Exit:
      Set Inbox = Nothing
      Set SubFolder = Nothing
      Set olNs = Nothing
      Set Item = Nothing
  
  Exit Sub
  
  '// Error information
  MsgErr:
     MsgBox "An unexpected Error has occurred." _
       &amp; vbCrLf &amp; "Error Number: " &amp; Err.Number _
       &amp; vbCrLf &amp; "Error Description: " &amp; Err.Description _
       , vbCritical, "Error!"
    Resume MsgErr_Exit
  End Sub
  </code></pre>
  
  <p>I want the code to read the active sheet columns, as follow:</p>
  
  <pre><code>Subject.mail   folder_name
      A                1
      B                2
      C                3
  </code></pre>
  
  <p>For example Mail in the Inbox with subject "A" then it has to place that mail in folder "1".</p>
  
  <p>How do I loop? to look at the Sheet1 and to read to which sub folder it has to move ? </p>