Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I have a problem in a code because I want to move to next iteration in a For..next cycle.
When I read an Excel Files, I write a For..next cycle to read every cells, but if the string contains a specific word I need to pass at next iteration.
This is what I read from Excel File. In the second column when I find the word "ANGOLO" (yellow cells) I need to move to next iteration. I attached my Ilogic code
Nome_File_XLS="TK190037_Pavia_Distinta di produzione -RIVESTIMENTO"
SharedVariable("Percorso") = "C:\Users\filippo.costantin\Desktop\WORKPLACE"
'parameter foglio excel
Dim File_corrente = Nome_File_XLS
Dim X_NomeFoglio As String = "Lamiera"
Dim X_PRCodice As String = "C"
Dim X_Descrizione As String = "D"
Dim X_Quantità As String = "E"
Dim X_Colore As String = "F"
Dim X_Spessore As String = "G"
Dim X_HPannello As String = "H"
Dim X_Modulo As String = "J"
Dim X_Gancio As String = "K"
Dim X_CTG As String = "P"
Dim X_Lavorazione As String ="S"
'parametri del pannello
Dim PR_Codice As String
Dim Descrizione As String
For i As Integer = 60 To 70
PR_Codice = GoExcel.CellValue(SharedVariable("Percorso") & "\" & File_corrente, X_NomeFoglio, X_PRCodice & i)
Descrizione=GoExcel.CellValue(SharedVariable("Percorso") & "\" & File_corrente, X_NomeFoglio, X_Descrizione & i)
MessageBox.Show(PR_Codice, "Title")
If (String.IsNullOrEmpty(PR_Codice)) Then
Exit For
MessageBox.Show("NULLA", "Title")
End If
If Descrizione.Contains("Angolo") = True Then
MessageBox.Show("Angolo", "Title")
Continue For
End If
Next
I try to use "Continue For" but it doesen't run correctly.
Can someone help me?
Solved! Go to Solution.