If you want to produce good quality code in VBA do the following:
- Option Explicit (From the start!)
- NO ERROR CONTROL! (Do not use error control to avoid making things correctly..)
- Goto is banned.
If you follow these simple instructions you've already got a fairly good standard of code.. then just write.. optimize... test... write... optimize...
Look at this:
Open sz For Input As #7
ERRLINS = 0
THISLIN$ = "**END**"
On Error Resume Next
Line Input #7, THISLIN$
If THISLIN$ = "**END**" Then Exit Do
If THISLIN$ <> "" Then
ERRLINS = ERRLINS + 1