Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

faire remonter une info

4 réponses
Avatar
dracbi
bonjour,

j'ai un tableau de 4 colonnes de longueur variable r=E9p=E9t=E9 X fois
soit un tableau de ce genre :

RangemT AD8 RangemT AD9

RAL Longueur Quantit=E9 RAL Longueur Quantit=E9
9010 3,9 1
9010 4,3 1 9010 4,3
1

9010 3,9 1
9010 4,2 1
9010 6 1
9010 6 1

Comment puis je faire pour supprimer les vides et remonter les info en
haut de tableau ?

Cordialement

Benjamin

4 réponses

Avatar
Daniel.C
Bonjour.
Esssaie :
Sub test1()
Dim Ligne As Long
Ligne = Cells.Find("*", [A65000], , , , xlPrevious).Row
For i = Ligne To 1 Step -1
If Application.CountA(Rows(i)) = 0 Then
Rows(i).Delete
End If
Next i
End Sub
Cordialement.
Daniel

bonjour,

j'ai un tableau de 4 colonnes de longueur variable répété X fois
soit un tableau de ce genre :

RangemT AD8 RangemT AD9

RAL Longueur Quantité RAL Longueur Quantité
9010 3,9 1
9010 4,3 1 9010 4,3
1

9010 3,9 1
9010 4,2 1
9010 6 1
9010 6 1

Comment puis je faire pour supprimer les vides et remonter les info en
haut de tableau ?

Cordialement

Benjamin


Avatar
dracbi
On 4 nov, 13:06, Daniel.C wrote:
Bonjour.
Esssaie :
Sub test1()
Dim Ligne As Long
Ligne = Cells.Find("*", [A65000], , , , xlPrevious).Row
For i = Ligne To 1 Step -1
    If Application.CountA(Rows(i)) = 0 Then
        Rows(i).Delete
    End If
Next i
End Sub
Cordialement.
Daniel

> bonjour,

> j'ai un tableau de 4 colonnes de longueur variable r p t X fois
> soit un tableau de ce genre :

> RangemT    AD8                                      RangemT        AD9

> RAL        Longueur        Quantit                       RAL    Longueur        Quantit
> 9010          3,9      1
> 9010          4,3              1                           9010       4,3
> 1

> 9010          3,9              1
> 9010          4,2              1
> 9010          6                1
> 9010          6                1

> Comment puis je faire pour supprimer les vides et remonter les info en
> haut de tableau ?

> Cordialement

> Benjamin



Bonsoir Daniel.C,

Merci pour ta réponse cependant ici on supprime une ligne complete or
mes tableaux se repetent sur la largeur.
Une ligne correspond a 3 colonnes comme au dessus.

Cordialement,

Benjamin
Avatar
Daniel.C
Bonsoir.
Essaie :

Sub test1()
Dim Ligne As Long, c As Long, i As Long, Plage As Range
For i = 1 To [IV1].End(xlToLeft).Column - 1 Step 4
Set Plage = Range("A1:C65000").Offset(, i - 1)
Plage.Select
Ligne = Plage.Find("*", [A65000].Offset(, i - 1), , , ,
xlPrevious).Row
For j = Ligne To 1 Step -1
If Application.CountA(Range(Cells(j, i), Cells(j, i + 2))) = 0
Then
Range(Cells(j, i), Cells(j, i + 2)).Delete xlUp
End If
Next j
Next i
End Sub


On 4 nov, 13:06, Daniel.C wrote:
Bonjour.
Esssaie :
Sub test1()
Dim Ligne As Long
Ligne = Cells.Find("*", [A65000], , , , xlPrevious).Row
For i = Ligne To 1 Step -1
    If Application.CountA(Rows(i)) = 0 Then
        Rows(i).Delete
    End If
Next i
End Sub
Cordialement.
Daniel

bonjour,



j'ai un tableau de 4 colonnes de longueur variable r p t X fois
soit un tableau de ce genre :



RangemT    AD8                                      RangemT        AD9
RAL        Longueur        Quantit                       RAL    Longueur  
     Quantit 9010          3,9      1
9010          4,3              1                           9010       4,3
1



9010          3,9              1
9010          4,2              1
9010          6                1
9010          6                1



Comment puis je faire pour supprimer les vides et remonter les info en
haut de tableau ?



Cordialement



Benjamin





Bonsoir Daniel.C,

Merci pour ta réponse cependant ici on supprime une ligne complete or
mes tableaux se repetent sur la largeur.
Une ligne correspond a 3 colonnes comme au dessus.

Cordialement,

Benjamin


Avatar
dracbi
On 5 nov, 21:22, Daniel.C wrote:
Bonsoir.
Essaie :

Sub test1()
Dim Ligne As Long, c As Long, i As Long, Plage As Range
For i = 1 To [IV1].End(xlToLeft).Column - 1 Step 4
    Set Plage = Range("A1:C65000").Offset(, i - 1)
    Plage.Select
    Ligne = Plage.Find("*", [A65000].Offset(, i - 1), , , ,
xlPrevious).Row
    For j = Ligne To 1 Step -1
        If Application.CountA(Range(Cells(j, i), Cells(j, i + 2)) ) = 0
Then
            Range(Cells(j, i), Cells(j, i + 2)).Delete xlUp
        End If
    Next j
Next i
End Sub

> On 4 nov, 13:06, Daniel.C wrote:
>> Bonjour.
>> Esssaie :
>> Sub test1()
>> Dim Ligne As Long
>> Ligne = Cells.Find("*", [A65000], , , , xlPrevious).Row
>> For i = Ligne To 1 Step -1
>>     If Application.CountA(Rows(i)) = 0 Then
>>         Rows(i).Delete
>>     End If
>> Next i
>> End Sub
>> Cordialement.
>> Daniel

>>> bonjour,

>>> j'ai un tableau de 4 colonnes de longueur variable r p t X fois
>>> soit un tableau de ce genre :

>>> RangemT    AD8                                      RangemT        AD9
>>> RAL        Longueur        Quantit                       RAL    Longueur  
>>>      Quantit 9010          3,9      1
>>> 9010          4,3              1                           9010       4,3
>>> 1

>>> 9010          3,9              1
>>> 9010          4,2              1
>>> 9010          6                1
>>> 9010          6                1

>>> Comment puis je faire pour supprimer les vides et remonter les info e n
>>> haut de tableau ?

>>> Cordialement

>>> Benjamin

> Bonsoir Daniel.C,

> Merci pour ta réponse cependant ici on supprime une ligne complete or
> mes tableaux se repetent sur la largeur.
> Une ligne correspond a 3 colonnes comme au dessus.

> Cordialement,

> Benjamin



Bonjour,

Merci beaucoup j'ai solutionné mon problème différemment.
Le probleme n'était pas assez explicite.
En fait ma page contenant le tableaux de fait ainsi :
Tableau 1 =
Col A
Col B
Col C
Col D

Tableau 2 =
Col E
Col F
Col G
Col H
.....
Si A,B,C,D est = "" alors je veaux remonter l'info an premiere ligne
de debut tableau soit ligne 4

J'ai solutionné comme ca :
Sub xxx_Rangement()
Call Macro2

Feuil3.Cells.Clear
Feuil3.Rows(3).Interior.Color = vbBlack 'ligne en noir
Feuil3.Rows(3).Font.Color = vbRed 'police en rouge

Dim pa As Long
Dim compteur As Integer 'définit la largeur utilisé du nouv tab
Dim Ligneb As Long 'ligne de la feuille 2
Dim Ligne As Long
Dim Rangement As String
Dim i As Integer

pa = 0
compteur = 0

'************************************************************************** ************
'boucle dans Feuil1: Liste rangement
'__________________________________________________________________________ ____________
'************************************************************************** ************

For Ligne = 2 To 100
pa = pa + 4
Rangement = Feuil4.Cells(Ligne, 3).Value 'feuil4þuille liste
rangement
If Rangement <> "" Then
compteur = compteur + 1
'en tete
Feuil3.Cells(1, 1 + pa - 4) = "RangemT"
Feuil3.Cells(1, 2 + pa - 4) = Rangement
Feuil3.Cells(1, 2 + pa - 4).Interior.ColorIndex = 22
'En tete des lignes
Feuil3.Cells(3, 1 + pa - 4) = "RAL"
Feuil3.Cells(3, 2 + pa - 4) = "Longueur"
Feuil3.Cells(3, 3 + pa - 4) = "Quantité"
Feuil3.Columns(pa).Interior.ColorIndex = 33
End If
Next Ligne

*************************************************************************** ************************************************************
Largeur du tableau
___________________________________________________________________________ _____________________
*************************************************************************** ************************************************************

For i = 2 To compteur * 4 Step 4
For Ligneb = 2 To 35000
If Feuil2.Cells(Ligneb, 1).Value = Feuil3.Cells(1,
i).Value Then
Feuil3.Cells(Ligneb + 2, i - 1).End(xlUp).Offset(1, 0)
= Feuil2.Cells(Ligneb, 2).Value
Feuil3.Cells(Ligneb + 2, i).End(xlUp).Offset(1, 0) =
Feuil2.Cells(Ligneb, 3).Value
Feuil3.Cells(Ligneb + 2, i + 1).End(xlUp).Offset(1, 0)
= Feuil2.Cells(Ligneb, 4).Value
End If
Next Ligneb
Next i

Feuil3.Select

End Sub