The code you posted has an extra End If line, but that aside it does act on unread items in the Inbox. The burning question relates to my_Sub, which you haven't shared. It seems likely that any issues relating to the processing should be found there.
Option Explicit
Public Sub Unread_Emails()
Dim myNameSpace As Outlook.NameSpace
Dim myInbox As Outlook.Folder
Dim myItem As MailItem
Dim lngCount As Long
Set myNameSpace = Application.GetNamespace("MAPI")
Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox)
MsgBox myInbox.UnReadItemCount
If myInbox.UnReadItemCount > 0 Then
For lngCount = myInbox.Items.Count To 1 Step -1
If TypeName(myInbox.Items(lngCount)) = "MailItem" Then
If myInbox.Items(lngCount).UnRead = True Then
Set myItem = myInbox.Items(lngCount)
Debug.Print myItem.Subject
'Call my_Sub
End If
End If
DoEvents
Next lngCount
End If
Set myNameSpace = Nothing
Set myInbox = Nothing
Set myItem = Nothing
End Sub