How to simulate a continue statment in vba for loop

I am trying to go to the next iteration of a for loop when certain conditions are met.  In this case when the column number is 18 and the value is 0.  The code in question is on line 21 where I go back to NextLoop:  Does my code look right.  Thanks.
Public Function RangeToCSV(list As Range) As String
    ' Comments:
    ' Params  : list
    ' Returns : String
    ' Modified:
    
    'TVCodeTools ErrorEnablerStart
    On Error GoTo PROC_ERR
    'TVCodeTools ErrorEnablerEnd
    
    Dim strTmp As String
    Dim lngCurrentRow As Long
    Dim lngCurrentColumn As Long
    Dim rng As Range
    Dim xlsRange As Range
    
    If TypeName(list) = "Range" Then
        lngCurrentRow = 15
NextLoop:
        For Each rng In list.Cells
            If Range(rng.Address).Column > 14 Then
                If Range(rng.Address).Column = 18 Then
                    If rng.value = 0 Or rng.value = "" Then
                        GoTo NextLoop
                    End If
                End If
                    
                If rng.row = lngCurrentRow Then
                    If strTmp = vbNullString Then
                        strTmp = rng.value
                    Else
                        strTmp = strTmp & "," & rng.value
                    End If
                Else
                    lngCurrentRow = lngCurrentRow + 1
                    If strTmp = vbNullString Then
                        strTmp = rng.value
                    Else
                        strTmp = strTmp & Chr(10) & rng.value
                    End If
                End If
            End If
        Next
    End If
    
    RangeToCSV = strTmp
    
    'TVCodeTools ErrorHandlerStart
PROC_EXIT:
    Application.EnableEvents = True
    Exit Function
    
PROC_ERR:
    MsgBox Err.Description, vbCritical, "Sheet1.RangeToCSV"
    Resume PROC_EXIT
    'TVCodeTools ErrorHandlerEnd
    
End Function

Open in new window

Juan VelasquezAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

junholeeCommented:
Don't need goto statement I think.
Public Function RangeToCSV(list As Range) As String
    ' Comments:
    ' Params  : list
    ' Returns : String
    ' Modified:
    
    'TVCodeTools ErrorEnablerStart
    On Error GoTo PROC_ERR
    'TVCodeTools ErrorEnablerEnd
    
    Dim strTmp As String
    Dim lngCurrentRow As Long
    Dim lngCurrentColumn As Long
    Dim rng As Range
    Dim xlsRange As Range
    
    If TypeName(list) = "Range" Then
        lngCurrentRow = 15

        For Each rng In list.Cells
            If Range(rng.Address).Column > 14 Then
                If Range(rng.Address).Column = 18 Then
Else
                    If rng.value = 0 Or rng.value = "" Then
            Else
                    
                If rng.row = lngCurrentRow Then
                    If strTmp = vbNullString Then
                        strTmp = rng.value
                    Else
                        strTmp = strTmp & "," & rng.value
                    End If
                Else
                    lngCurrentRow = lngCurrentRow + 1
                    If strTmp = vbNullString Then
                        strTmp = rng.value
                    Else
                        strTmp = strTmp & Chr(10) & rng.value
                    End If
                End If
End If
End If
            End If
        Next
    End If
    
    RangeToCSV = strTmp
    
    'TVCodeTools ErrorHandlerStart
PROC_EXIT:
    Application.EnableEvents = True
    Exit Function
    
PROC_ERR:
    MsgBox Err.Description, vbCritical, "Sheet1.RangeToCSV"
    Resume PROC_EXIT
    'TVCodeTools ErrorHandlerEnd
    
End Function

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.