A voir également:
- VBA aide pour débutant
- Find vba - Astuces et Solutions
- Vba attendre 1 seconde ✓ - Forum VB / VBA
- Incompatibilité de type vba ✓ - Forum Programmation
- Vba dernière colonne non vide ✓ - Forum VB / VBA
- Vba récupérer valeur cellule ✓ - Forum VB / VBA
2 réponses
SkyRhum
Messages postés
10
Date d'inscription
lundi 17 octobre 2011
Statut
Membre
Dernière intervention
17 octobre 2011
1
17 oct. 2011 à 18:21
17 oct. 2011 à 18:21
Bonjour,
Je ferai qqch comme ceci :
Sub envoi_a_feuil2()
Dim Rng As Range
Dim cel As Range
For Each cel In Feuil1.UsedRange.Offset(, 1).Resize(, 1)
If cel.Value = "Non Joué" Then
cel.EntireRow.Copy Feuil2.Cells(Feuil2.Range("A65536").End(xlUp).Row + 1, 1)
If Rng Is Nothing Then
Set Rng = cel.EntireRow
Else
Set Rng = Union(Rng, cel.EntireRow)
End If
End If
Next cel
Rng.Select
Selection.Delete Shift:=xlUp
End Sub
Ce n'est pas testé, donc je ne te garanti pas que cela marche.
Je ferai qqch comme ceci :
Sub envoi_a_feuil2()
Dim Rng As Range
Dim cel As Range
For Each cel In Feuil1.UsedRange.Offset(, 1).Resize(, 1)
If cel.Value = "Non Joué" Then
cel.EntireRow.Copy Feuil2.Cells(Feuil2.Range("A65536").End(xlUp).Row + 1, 1)
If Rng Is Nothing Then
Set Rng = cel.EntireRow
Else
Set Rng = Union(Rng, cel.EntireRow)
End If
End If
Next cel
Rng.Select
Selection.Delete Shift:=xlUp
End Sub
Ce n'est pas testé, donc je ne te garanti pas que cela marche.
Voici mon code pour le moment:
Cela ne marche pas...ni le tiens
Private Sub CommandButton4_Click()
With Sheets("JOUE")
Dim Lign As Long, DrLig As Long
DrLig = .Columns(2).Find("*", , , , xlByColumns, xlPrevious).Row
For Lign = 4 To DrLig
If UCase(.Cells(Lign, 6)) = "MATCH JOUES" Then
Sheets("A JOUE").Range("b65536").End(xlUp).Offset(1, 0) = .Cells(Lign, 6).Value
End If
Next Lign
End With
End Sub
Cela ne marche pas...ni le tiens
Private Sub CommandButton4_Click()
With Sheets("JOUE")
Dim Lign As Long, DrLig As Long
DrLig = .Columns(2).Find("*", , , , xlByColumns, xlPrevious).Row
For Lign = 4 To DrLig
If UCase(.Cells(Lign, 6)) = "MATCH JOUES" Then
Sheets("A JOUE").Range("b65536").End(xlUp).Offset(1, 0) = .Cells(Lign, 6).Value
End If
Next Lign
End With
End Sub