Selectionner et copier deux colonne non vide

maval

XLDnaute Barbatruc
Bonjour,

J'ai un code pour sélectionner et copier 1 colonne "F" non vide qui fonctionne très bien, j'aimerais lui mettre une deuxième colonne soit "E et F"
Voici mon code:
Code:
Sub selectionnerCopierTrans_list()
  Dim Plg As Range, dlig&, Lig&: Application.ScreenUpdating = False
  dlig = Cells(Rows.Count, 6).End(xlUp).Row: If dlig < 5 Then Exit Sub
  Set Plg = Cells(dlig, 6)
  For Lig = 5 To dlig - 1
    If Not IsEmpty(Cells(Lig, 6)) Then Set Plg = Union(Plg, Cells(Lig, 6))
  Next Lig
  Plg.Select: Selection.Copy
End Sub

je vous remercie d'avance

Max
 

Theze

XLDnaute Occasionnel
Bonjour,

Une piste :
Code:
Sub selectionnerCopierTrans_list()

  Dim Plg As Range, dlig&, Lig&
 
  Application.ScreenUpdating = False
 
  dlig = Cells(Rows.Count, 6).End(xlUp).Row: If dlig < 5 Then Exit Sub
 
  Set Plg = Range(Cells(dlig, 5), Cells(dlig, 6))
 
  For Lig = 5 To dlig - 1
    If Not IsEmpty(Cells(Lig, 6)) Then Set Plg = Union(Plg, Range(Cells(Lig, 5), Cells(Lig, 6)))
  Next Lig
 
  Plg.Select: Selection.Copy
 
End Sub
 

maval

XLDnaute Barbatruc
Re,

Bon je vais voir comment faire.
Je voulais te demander il y a quelque temps en arrière tu m'avait fait un code pour transposer qui fonctionne très bien et je ten remercie encore.
je voudrais fais la même chose mais plus simple peut tu m'aider.
Voila le fichier en feuil 2

Merci encore
 

Pièces jointes

  • trans_list.xlsm
    29.1 KB · Affichages: 19

Statistiques des forums

Discussions
312 291
Messages
2 086 841
Membres
103 399
dernier inscrit
Tassiou