Bonjour
J'aimerais copier la selection de ligne une fois que mon filtre a été fait, or je n'y arrive pas en VBA et a chaque fois il me compte toutes les lignes..
est ce que qqun aurait une idée de comment faire??
Range("B4:I4").AutoFilter
Selection.AutoFilter Field:=8, Criteria1:= _
nomchantier, Operator:=xlAnd
Cells.UnMerge
nblignes = Range("B5:B" & Range("B8000").End(xlUp).Row).SpecialCells(xlVisible).Count
Range("B5:F" & nblignes).SpecialCells(xlVisible).Select
Selection.Copy
Windows(nomfichiergestion).Activate
Cells(5, 8 + i * 7).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range(Cells(2, 8 + i * 7), Cells(2, 13 + i * 7)).UnMerge
Range(Cells(2, 8 + i * 7), Cells(2, 13 + i * 7)).Merge
Cells(2, 8 + i * 7).Value = "Exercice du 1er octobre " & anneedebutchantier & " au 30 septembre " & anneedebutchantier + 1
J'aimerais copier la selection de ligne une fois que mon filtre a été fait, or je n'y arrive pas en VBA et a chaque fois il me compte toutes les lignes..
est ce que qqun aurait une idée de comment faire??
Range("B4:I4").AutoFilter
Selection.AutoFilter Field:=8, Criteria1:= _
nomchantier, Operator:=xlAnd
Cells.UnMerge
nblignes = Range("B5:B" & Range("B8000").End(xlUp).Row).SpecialCells(xlVisible).Count
Range("B5:F" & nblignes).SpecialCells(xlVisible).Select
Selection.Copy
Windows(nomfichiergestion).Activate
Cells(5, 8 + i * 7).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range(Cells(2, 8 + i * 7), Cells(2, 13 + i * 7)).UnMerge
Range(Cells(2, 8 + i * 7), Cells(2, 13 + i * 7)).Merge
Cells(2, 8 + i * 7).Value = "Exercice du 1er octobre " & anneedebutchantier & " au 30 septembre " & anneedebutchantier + 1