Your best bet is to use some subroutines and/or functions to compartmentalize your code. Using or overusing GoTo
statements gets messy, as you observe.
Sub errorinsight()
Dim i As Long, j As Long, r As Range
Dim ucolumn As String
Dim counter As Integer: counter = 0
Sheets("sheet1").Activate
'if your data is in a different column then change L to some other letter(s)
ucolumn = "L" 'pick up contr.
For i = 2 To Range(ucolumn & Rows.Count).End(xlUp).Row
Set r = Range(ucolumn & i)
If Not r = MAXXAM AND Not r = SGS Then
FlagErrors ucolumn, r, counter + 1
End If
Next i
End Sub
Sub FlagErrors(ucolumn as String, i as Long, r as Range, byRef counter as Integer)
Dim xerror As Range, yerror As Range
Sheets.Add.Name = "errorsheet" & Format(Now, "yyyy_mm_dd ss_nn_hh")
Range("A" & counter) = ucolumn & i
Range("B" & counter) = r
Sheets("sheet1").Activate
'I remove this block because it doesn't do anything.
' * uColumn is hardcoded as "L" in your procedure above
' * samplecodelink is an undefined label in your procedure and will raise an error
' * GoTo compLink is unnecessary since this sub will return to the next line in the calling procedure
'If ucolumn = "A" Then
'GoTo samplecodelink
' ElseIf ucolumn = "L" Then
'GoTo complink
' Else
' End If
End Sub