Maybe:

--//--

For I = 1 To strLength

For N = 1 To 128

If Mid(s, I, 1) = HTML(N) And HTML(N) <> "x"

Then

TekstAsHTML = TekstAsHTML + "&" + (N + 127) + ";"

Exit For 'ingen grund til at fortsætte hvis vi har fundet en skyldig.'

Else

TekstAsHTML = TekstAsHTML + Mid(s, I, 1)

End If

Next N

Next I

--//--

I.e., i guess you meant Mid(s, I, 1).

--//--

For I = 1 To strLength

For N = 1 To 128

If Mid(s, I, 1) = HTML(N) And HTML(N) <> "x"

Then

TekstAsHTML = TekstAsHTML + "&" + (N + 127) + ";"

Exit For 'ingen grund til at fortsætte hvis vi har fundet en skyldig.'

Else

TekstAsHTML = TekstAsHTML + Mid(s, I, 1)

End If

Next N

Next I

--//--

I.e., i guess you meant Mid(s, I, 1).