0

I got this error message:

Compile Error End If without block if

in the last End If instruction

Would you please share with me your answers.

Than you in advance. I really appreciate your help.

            If rompeControl = "" Then
            rompeControl = sheet_E.Range("H" & nf).Value
            wkFecha = sheet_E.Range("G" & nf).Value
            wkRuc = sheet_E.Range("J" & nf).Value
            If (sheet_E.Range("J" & nf) > "90000000") Then nc = 99
            Else
            sheet_E.Range("R" & nf) = Len(sheet_E.Range("J" & nf))
            nc = sheet_E.Range("R" & nf).Value
            End If

            wkLocal = sheet_E.Range("N" & nf).Value
            wkDebito = 0#
            wkCredito = 0#
            wkDebitoT = 0#
            wkCreditoT = 0#
            wkTipoId = "04"
            wkTipoDoc = "18"
        End If

1 Answer 1

2

It should be:

 If (sheet_E.Range("J" & nf) > "90000000") Then 
     nc = 99
 Else
     sheet_E.Range("R" & nf) = Len(sheet_E.Range("J" & nf))
     nc = sheet_E.Range("R" & nf).Value
 End If

You can put it like this If (sheet_E.Range("J" & nf) > "90000000") Then nc = 99 only in case of not having an else.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.