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

copier des lignes

3 réponses
Avatar
Fredy
Bonjour =E0 tous ,
Je cherche mais ne trouve pas.
Copier toutes les lignes d'une feuille,vers une autre feuille,
ayant << LM et LF >> dans la colonne 14 (en VBA).
Merci pour toute aide.

3 réponses

Avatar
Philippe.R
Bonjour,
Une piste en copiant la feuille vers une autre et en y supprimant les lignes
indésirables

Sub copilignes()
Application.ScreenUpdating = False
Sheets("Feuil1").Cells.Copy
Sheets("Feuil2").Select
Cells.Select
ActiveSheet.Paste
derlig = Range("N6543").End(xlUp).Row
For i = derlig To 1 Step -1
If Cells(i, 14).Value = "LF" Or _
Cells(i, 14).Value = "LM" Then
i = i
Else
Cells(i, 14).EntireRow.Delete
End If
Next i
Sheets("Feuil1").Select
Application.ScreenUpdating = True
End Sub

--
Avec plaisir
http://dj.joss.free.fr/trombine.htm
http://jacxl.free.fr/mpfe/trombino.html
Philippe.R
Pour se connecter au forum :
http://www.excelabo.net/mpfe/connexion.php
News://news.microsoft.com/microsoft.public.fr.excel
"Fredy" a écrit dans le message de
news:
Bonjour à tous ,
Je cherche mais ne trouve pas.
Copier toutes les lignes d'une feuille,vers une autre feuille,
ayant << LM et LF >> dans la colonne 14 (en VBA).
Merci pour toute aide.
Avatar
Fredy
Re bonjour ,
ça marche
Merci à Philippe.R

On 24 mar, 16:53, "Philippe.R" <AS_rauphil_chez_wanadoo.fr> wrote:
Bonjour,
Une piste en copiant la feuille vers une autre et en y supprimant les lign es
indésirables

Sub copilignes()
Application.ScreenUpdating = False
    Sheets("Feuil1").Cells.Copy
    Sheets("Feuil2").Select
    Cells.Select
    ActiveSheet.Paste
    derlig = Range("N6543").End(xlUp).Row
    For i = derlig To 1 Step -1
        If Cells(i, 14).Value = "LF" Or _
            Cells(i, 14).Value = "LM" Then
            i = i
        Else
            Cells(i, 14).EntireRow.Delete
        End If
    Next i
Sheets("Feuil1").Select
Application.ScreenUpdating = True
End Sub

--
Avec plaisirhttp://dj.joss.free.fr/trombine.htmhttp://jacxl.free.fr/mpfe/t rombino.html
Philippe.R



Avatar
Philippe.R
C'était avec plaisir ; une variante :

Sub copilignes()
Application.ScreenUpdating = False
Sheets("Feuil1").Cells.Copy
Sheets("Feuil2").Select
Cells.Select
ActiveSheet.Paste
derlig = Range("N6543").End(xlUp).Row
For i = derlig To 1 Step -1
If Cells(i, 14).Value <> "LF" And _
Cells(i, 14).Value <> "LM" Then
Cells(i, 14).EntireRow.Delete
End If
Next i
Sheets("Feuil1").Select
Application.ScreenUpdating = True
End Sub


--
Avec plaisir
http://dj.joss.free.fr/trombine.htm
http://jacxl.free.fr/mpfe/trombino.html
Philippe.R
Pour se connecter au forum :
http://www.excelabo.net/mpfe/connexion.php
News://news.microsoft.com/microsoft.public.fr.excel
"Fredy" a écrit dans le message de
news:
Re bonjour ,
ça marche
Merci à Philippe.R

On 24 mar, 16:53, "Philippe.R" <AS_rauphil_chez_wanadoo.fr> wrote:
Bonjour,
Une piste en copiant la feuille vers une autre et en y supprimant les
lignes
indésirables

Sub copilignes()
Application.ScreenUpdating = False
Sheets("Feuil1").Cells.Copy
Sheets("Feuil2").Select
Cells.Select
ActiveSheet.Paste
derlig = Range("N6543").End(xlUp).Row
For i = derlig To 1 Step -1
If Cells(i, 14).Value = "LF" Or _
Cells(i, 14).Value = "LM" Then
i = i
Else
Cells(i, 14).EntireRow.Delete
End If
Next i
Sheets("Feuil1").Select
Application.ScreenUpdating = True
End Sub

--
Avec
plaisirhttp://dj.joss.free.fr/trombine.htmhttp://jacxl.free.fr/mpfe/trombino.html
Philippe.R