Ciao ragazzi,
mi sono appena iscritto, quindi un grosso saluto a tutti quanti, detto questo veniamo al motivo:
Stò scrivendo il codice di una macro excel, ma quando vado a lanciarla mi dice "End If without block If", sareste così gentili da illuminarmi?
'BackOffice
Worksheets("Configurazioni").Activate
If Range("A18") = Range("C18") Then
Worksheets("Person").Activate
Rows("20:25").Select
Selection.Delete Shift:=xlUp
Worksheets("Configurazioni").Activate
End
Else
For i = 1 To (NumeroOperatori - 3)
Worksheets("Person").Activate
Rows("24:24").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Next
For i = 1 To (NumeroOperatori - 3)
Worksheets("Person").Activate
Rows("21:21").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End If
Next
'OutBound
Worksheets("Configurazioni").Activate
If Range("A16") = Range("C16") Then
Worksheets("Person").Activate
Rows("14:19").Select
Selection.Delete Shift:=xlUp
Worksheets("Configurazioni").Activate
End
Else
For i = 1 To (NumeroOperatori - 3)
Worksheets("Person").Activate
Rows("18:18").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Next
For i = 1 To (NumeroOperatori - 3)
Worksheets("Person").Activate
Rows("15:15").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End If
Next
' linea
Worksheets("Configurazioni").Activate
If Range("A14") = Range("C14") Then
Worksheets("Person").Activate
Rows("8:13").Select
Selection.Delete Shift:=xlUp
Worksheets("Configurazioni").Activate
End
Else
For i = 1 To (NumeroOperatori - 3)
Worksheets("Person").Activate
Rows("12:12").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Next
For i = 1 To (NumeroOperatori - 3)
Worksheets("Person").Activate
Rows("9:9").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End If
Next