Comment specifier la plage "Feuil1" de la macro suivante, j'aimerai affecter cette macro a la plage "C1:S54" en "Feuil1" (et ceci sans changer le format des cellules, ce fichier est protégé par un mot de pase), car actuellement elle s'execute sur l'ensemble de la "Feuil1".
cordialement,
RVL
Sub f1versf2a()
Dim plage As Range, c As Range, cSource As Range
'Définition de la plage de cellules qui contient les noms en feuil3
With Sheets("Feuil3")
Set plage = .Range(.Range("A2"), .Range("A" & .Rows.Count).End(xlUp))
End With
For Each c In plage
If c(1, 9) = "A" Then
Set cSource = Sheets("Feuil1").UsedRange.Find(What:=c, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)
If Not cSource Is Nothing Then
cSource.Cut Destination:=Sheets("Feuil2").Range("U" & Application.Rows.Count).End(xlUp)(2)
End If
End If
Next
Application.CutCopyMode = False
End Sub
cordialement,
RVL
Sub f1versf2a()
Dim plage As Range, c As Range, cSource As Range
'Définition de la plage de cellules qui contient les noms en feuil3
With Sheets("Feuil3")
Set plage = .Range(.Range("A2"), .Range("A" & .Rows.Count).End(xlUp))
End With
For Each c In plage
If c(1, 9) = "A" Then
Set cSource = Sheets("Feuil1").UsedRange.Find(What:=c, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)
If Not cSource Is Nothing Then
cSource.Cut Destination:=Sheets("Feuil2").Range("U" & Application.Rows.Count).End(xlUp)(2)
End If
End If
Next
Application.CutCopyMode = False
End Sub