This is VERY BAD coding practice, so do not try this at home. At least not before carefully saving your project, and not before you understand fully what it does.
But just in case you want to experiment at your own risk, here are the helper Subs that add and remove code line tags.
You have been warned, I must decline responsibility for what might happen.
1. copy one or more subs in your code to clipboard (THIS REPLACES WHAT WAS ON THE CLIPBOARD)
2. run AddLineTags (I put the call early in the code, and comment and uncomment as needed)
3. paste clipboard contents
I recommend pasting it in Notepad++, so you can check validity before transferring to the project.
It will not be always valid, so modify the helper subs to suit your needs.
Same for RemoveLineTags.
Don't forget to add a global "Private L_N As String"
Private Sub AddLineTags 'ignore
Dim codeLines As String = fx.Clipboard.GetString
Dim sb As StringBuilder: sb.Initialize
Dim v() As String = Regex.Split(Chr(13) & CRLF, codeLines)
Dim currentSub As String = "UNKNOWN"
Dim lineNumber As Int = -1
Dim skipTags As List = Array As String("end ", "for ", "do ", "try ", "catch ", "select ", "case ", "if ", "else ", "loop ", "next ")
For i = 0 To v.Length - 1
lineNumber = lineNumber + 1
Dim s As String = v(i)
sb.Append(s)
Dim t As String = s.trim.ToLowerCase
If t.Contains(" sub ") Then
Dim k2 As Int = s.IndexOf("(")
If k2 = -1 Then k2 = s.length
Dim prefix As String = s.SubString2(0, k2).trim
Dim k1 As Int = prefix.LastIndexOf(" ")
currentSub = prefix.SubString(k1 + 1)
lineNumber = 0
Else
Dim found As Boolean
For Each g As String In skipTags
If t.StartsWith(g) Then
found = True
Exit
End If
Next
If found = False Then sb.Append($" :L_N = "${currentSub}_${lineNumber}""$)
End If
If i < v.Length - 1 Then sb.append(CRLF)
Next
fx.Clipboard.SetString(sb.ToString)
End Sub
Private Sub RemoveLineTags 'ignore
Dim codeLines As String = fx.Clipboard.GetString
Dim sb As StringBuilder: sb.Initialize
Dim v() As String = Regex.Split(Chr(13) & CRLF, codeLines)
For i = 0 To v.Length - 1
Dim s As String = v(i)
Dim k As Int = s.IndexOf(" :L_N =")
If k > - 1 Then s = s.SubString2(0, k)
sb.Append(s)
If i < v.Length - 1 Then sb.append(CRLF)
Next
fx.Clipboard.SetString(sb.ToString)
End Sub