Sub htmltag()
Dim taht(2) As String
taht(0) = ">"
taht(1) = "<"
Dim sona As String
sonu = Selection.Words.Count
xmargid = 0
For nr = 1 To sonu
Set Loik = Selection.Words(nr)
For pikkus = 1 To Len(Loik)
ytaht = Mid(Loik, pikkus, 1)
For i = 0 To 1
If ytaht = taht(i) Then
xmargid = xmargid + 1
End If
Next i
Next pikkus
Next nr
MsgBox "< ja > märke oli tekstis kokku " & xmargid & "."
End Sub