Microsoft 365 copie cellule non vide

ROI1482

XLDnaute Nouveau
Bonjour à tous
sur la Feuil2 colonne Q8 à Q50
si Q8 n'est pas vide copier sa valeur sur la Feuil3 en A2 effectuer la macro IMPRIME2 (déjà existante)
puis si Q9 n'est pas vide copier sa valeur sur la Feuil3 en A2 effectuer la macro IMPRIME2
puis si Q10 ................
puis si Q11.................
puis arrêt à la première cellule vide QXX
Le tout en VBA sur 365
Un petit coup de main serait le bienvenu !!!
Merci
 
Solution
Bonjour,
Si j'ai bien compris :
VB:
Sub test()
Dim Cell As Range, Sadr As String
    With [Feuil2!Q8:Q50]
        Set Cell = .Find("*", [Feuil2!Q50], xlValues, xlWhole)
        Do While Not Cell Is Nothing
            If Sadr = "" Then Sadr = Cell.Address
            [Feuil3!A2] = Cell.Value
            Imprime2
            Set Cell = .FindNext(Cell)
            If Cell.Address = Sadr Then Set Cell = Nothing
        Loop
    End With
End Sub

fanch55

XLDnaute Barbatruc
Bonjour,
Si j'ai bien compris :
VB:
Sub test()
Dim Cell As Range, Sadr As String
    With [Feuil2!Q8:Q50]
        Set Cell = .Find("*", [Feuil2!Q50], xlValues, xlWhole)
        Do While Not Cell Is Nothing
            If Sadr = "" Then Sadr = Cell.Address
            [Feuil3!A2] = Cell.Value
            Imprime2
            Set Cell = .FindNext(Cell)
            If Cell.Address = Sadr Then Set Cell = Nothing
        Loop
    End With
End Sub
 

Discussions similaires

Statistiques des forums

Discussions
312 215
Messages
2 086 329
Membres
103 182
dernier inscrit
moutassim.amine