i have attached sheet and ocde...
My prob:
this line
NOM_SK = Sheets("CODICI").Range("I" + RIGA_SK)
cilciling the column I and get a value.
How to select NOM_SK based the value in

If Sess0.SCREEN.GETSTRING(4, 49, 7) = "MENSILE" Then GoTo LEGGI

example:

in the value in If Sess0.SCREEN.GETSTRING(4, 49, 7) = " " Then GoTo LEGGI is MENSILE select from column I only the value refred to MENSILE (see the reference record in column A and D in this case selct only from I the value in red

Code moved to workbook by HansV - it was much too long for a post.