Charger un tableau sous condition

akramenergie

XLDnaute Occasionnel
Bonjour les amis du forum

Je suis a la fin de mon projet et je suis bloqué sur un problème.

cette première partie du code je charge un tableau avec des donnée qui existe sur une feuille excel:


For i = 0 To derniere_ligne - 2


tab_exemple(i, 0) = Sheets("Synth_WEEK").Range("A" & i + 2)
tab_exemple(i, 1) = Sheets("Synth_WEEK").Range("B" & i + 2)
tab_exemple(i, 2) = Sheets("Synth_WEEK").Range("C" & i + 2)
tab_exemple(i, 3) = Sheets("Synth_WEEK").Range("D" & i + 2)
tab_exemple(i, 4) = Sheets("Synth_WEEK").Range("E" & i + 2)
tab_exemple(i, 4) = Sheets("Synth_WEEK").Range("F" & i + 2)

Next


Après cela je dois charger un autre tableau que j'ai nommés tab_alert() par les données du premier tableau sous conditions.

Ma condition est la suivante:

si tab_exemple(i, 1) > 0.4 --> il charge mon deuxième tableau pas les donnée...


Merci d'avance pour votre aide...
 

job75

XLDnaute Barbatruc
Re : Charger un tableau sous condition

Bonjour akramenergie, Theze,

Pas bien clair en effet, alors la boule de cristal.

En supposant que les 2 tableaux ont bien les mêmes dimensions :

Code:
With Sheets("Synth_WEEK")
For i = 0 To derniere_ligne - 2
  For j = 0 To 5
    tab_exemple(i, j) = .Cells(i + 2, j + 1)
  Next
  If tab_exemple(i, 1) > 0.4 Then
    For j = 0 To 5
      tab_alert(i, j) = tab_exemple(i, j)
    Next
  End If
Next
End With
A+
 

Discussions similaires

Statistiques des forums

Discussions
312 047
Messages
2 084 864
Membres
102 688
dernier inscrit
Biquet78