If you are trying to count how many "unique" names are in a list that could
contain duplicates, Jim Cone has that feature covered in his nifty commercial
Add-in called XLCompanion. It's available at http://www.realezsites.com/bus/primitivesoftware/
If you mean "Names" like Excel means "Names" (e.g. under
Insert>Names>Define)
here is an algorithm which illustrates how to iterate over the
collection of Excel Names:
Sub Count_Names()
Dim xName As Variant
Dim Result As Variant
Dim iCount As Integer
Dim List As Variant
iCount = 0
' Loop once for each name in the workbook.
For Each xName In ActiveWorkbook.Names
iCount = iCount + 1
List = List + " " & iCount & ") " & xName.Name & Chr(10)
' Loop to the next name.
Next xName
Result = MsgBox(prompt:="There are " & iCount & " Names in the
Active Workbook" & Chr(10) & List, Buttons:=vbOK)
End Sub