XL 2010 Si cellule vide recopier la ligne du dessous

BRUNO62

XLDnaute Occasionnel
Bonjour à Tous,
J'ai récupéré cette macro que je souhaite adapter
Je souhaite remplir les cellules vides de la colonne A en reprenant
les données du dessous de la colonne A à F
Les données recueillies en colonne A sont aléatoires
Merci, de votre aide
 

Pièces jointes

  • Copie suivant col A V1.xlsm
    22.1 KB · Affichages: 6
Solution
Bonsoir BRUNO62,

Exécutez cette macro :
VB:
Sub a()
On Error Resume Next 'si aucune SpecialCell
With [A2:F12] 'à adapter
    .NumberFormat = "0.000"
    .SpecialCells(xlCellTypeBlanks) = "=R[1]C"
    .Value = .Value
End With
End Sub
A+

job75

XLDnaute Barbatruc
Bonsoir BRUNO62,

Exécutez cette macro :
VB:
Sub a()
On Error Resume Next 'si aucune SpecialCell
With [A2:F12] 'à adapter
    .NumberFormat = "0.000"
    .SpecialCells(xlCellTypeBlanks) = "=R[1]C"
    .Value = .Value
End With
End Sub
A+
 

fanch55

XLDnaute Barbatruc
Bonsoir, macro modifiée :
VB:
Sub Copie()
Dim Derlig&, Maval As Range
    Derlig = Range("H" & Rows.Count).End(xlUp).Row
    If Derlig < 8 Then Derlig = 8
    Range("H2:H" & Derlig).Resize(, 6).ClearContents
    
    For i = Range("A" & Rows.Count).End(xlUp).Row To 2 Step -1
        If Range("A" & i) = "" Then
            Range("H" & i).Resize(, 6).Value = Maval.Value
        Else
            Range("H" & i).Resize(, 6).Value = Range("A" & i).Resize(, 6).Value
            Set Maval = Range("A" & i).Resize(, 6)
        End If
    Next i
End Sub
 

BRUNO62

XLDnaute Occasionnel
Bonsoir
Bonsoir, macro modifiée :
VB:
Sub Copie()
Dim Derlig&, Maval As Range
    Derlig = Range("H" & Rows.Count).End(xlUp).Row
    If Derlig < 8 Then Derlig = 8
    Range("H2:H" & Derlig).Resize(, 6).ClearContents
   
    For i = Range("A" & Rows.Count).End(xlUp).Row To 2 Step -1
        If Range("A" & i) = "" Then
            Range("H" & i).Resize(, 6).Value = Maval.Value
        Else
            Range("H" & i).Resize(, 6).Value = Range("A" & i).Resize(, 6).Value
            Set Maval = Range("A" & i).Resize(, 6)
        End If
    Next i
End Sub
Bonsoir franch55, c'est OK.... Grand Merci Bonne soirée
 

sihamidi

XLDnaute Occasionnel
Bonjour si vous êtes sur excel 365
mettez ce nom comme fonction

=LAMBDA(plage;MAP(plage;LAMBDA(a;SI(a>0;a;LET(zz;PRENDRE(PRENDRE(PRENDRE(plage; 1; );;-1):a;;1);RECHERCHEX(0;zz="";zz;0;1;-1))))))
 

Pièces jointes

  • suivant col A V3.xlsm
    23.3 KB · Affichages: 1

Discussions similaires

Statistiques des forums

Discussions
312 213
Messages
2 086 302
Membres
103 174
dernier inscrit
OBUTT