Variável com valor diferente do Array
Enviado: 31 Jul 2019 às 16:55
Boa tarde!
Pessoal, não entendo muito de VBA to apanhando e aprendendo. Eu queria fazer uma macro que se o valor que estiver na variável (estado_civil) for diferente de algum dos valores do Array, então ele seguiria o If. Segue o código que eu montei até agora.
i = 34
indice = Array(1, 2, 3, 4, 5, 6, 9)
For j = 1 To tamanho
If tp_vinculo(j) = 1 Or tp_vinculo(j) = 2 Or tp_vinculo(j) = 3 Or tp_vinculo(j) = 0 Or tp_vinculo(j) = "" Then
If estado_civil(j) <> indice Then
falta(i) = falta(i) + 1
Sheets("Crítica Ativos").Cells(10 + falta(i), 35) = matricula(j)
End If
End If
Next j
Pessoal, não entendo muito de VBA to apanhando e aprendendo. Eu queria fazer uma macro que se o valor que estiver na variável (estado_civil) for diferente de algum dos valores do Array, então ele seguiria o If. Segue o código que eu montei até agora.
i = 34
indice = Array(1, 2, 3, 4, 5, 6, 9)
For j = 1 To tamanho
If tp_vinculo(j) = 1 Or tp_vinculo(j) = 2 Or tp_vinculo(j) = 3 Or tp_vinculo(j) = 0 Or tp_vinculo(j) = "" Then
If estado_civil(j) <> indice Then
falta(i) = falta(i) + 1
Sheets("Crítica Ativos").Cells(10 + falta(i), 35) = matricula(j)
End If
End If
Next j