Selection derniere cellule non vide plage cellule Excel

gregfred8cs Messages postés 3 Date d'inscription jeudi 5 mars 2009 Statut Membre Dernière intervention 10 mars 2009 - 5 mars 2009 à 11:29
pile_poil Messages postés 682 Date d'inscription vendredi 6 avril 2007 Statut Membre Dernière intervention 4 août 2012 - 5 mars 2009 à 12:33
Bonjour à tous,

Voici mon problème ...

J'ai un tableau Excel qui comporte plusieurs ligne et colonne remplis.

Sur chaque ligne on a : un nom, un nom, une date, une date ....
Sachant que par ligne le nombre de date varie.

Exemple de tableau pour etre plus claire :

<col style=\"width: 60pt;\" span=\"5\" width=\"80\" />----
test, nomA, 12/01/2008, 12/03/2008, 12/05/2008, ----
test2, nomB, 12/05/2008, 12/02/2009, , ----
test3, nomC, 12/05/2008

Je voudrais donc avoir la possibilité pour l'ensemble du tableau de mette en couleur la dernière date de chaque ligne ...

MERCI d'avance
A voir également:

2 réponses

gregfred8cs Messages postés 3 Date d'inscription jeudi 5 mars 2009 Statut Membre Dernière intervention 10 mars 2009 1
5 mars 2009 à 12:07
Bon j'ai un début de code fonctionnel apparemment mais cela me parait compliqué et je pense qu'il y a plus simple ...

Sheets("Feuil2").Select
Range("A1:G8").Select

nligne = Selection.Rows.Count - 1
ncol = Selection.Columns.Count

For i = 1 To nligne
For j = 1 To ncol
If IsEmpty(Cells(i, j)) Then Cells(i, j).Interior.ColorIndex = 6
Next j
Next i

For i = 1 To nligne
For j = 1 To ncolIf Cells(i, j).Interior.ColorIndex 6 And Cells(i, j) "" Then Cells(i, (j - 1)).Interior.ColorIndex = 7

Next j
Next i

For i = 1 To nligne
For j = 1 To ncolIf Cells(i, j).Interior.ColorIndex 6 Then Cells(i, j).Interior.ColorIndex xlNoneIf Cells(i, j).Interior.ColorIndex 7 And Cells(i, j) "" Then Cells(i, j).Interior.ColorIndex = xlNone

Next j
Next i
1