excellentt
XLDnaute Nouveau
Pas faciles les demarrages...
Je bute depuis maintenant 1 semaine sur une macro.
Je commence par enregistrer une macro puis l'execute. ca marche...
ensuite je recopie le code de cette macro dans une private sub worksheet que voici
Private Sub Worksheet_Change(ByVal target As Range)
Dim i As Integer
Dim Plage As Range, Intersection As Range
Set Plage = Range("B9:B55")
Set Intersection = Application.Intersect(Plage, target)
If Not (Intersection Is Nothing) Then
i = 9
For i = 9 To 55 Step 1
If Cells(i, 8).Value = "OK" Then
If IsNumeric(Cells(i, 7)) Then
If Cells(i, 7).Value < Cells(4, 2).Value Then
Range(Cells(i, 1), Cells(i, 7)).Select
Selection.Copy
Sheets("portefeuille- compte").Activate
Range("A9").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Rows("9:9").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Else
End If
Else
End If
Else
End If
Next i
Cells(1, 1).Select
Selection.Copy
End If
end sub
Lors de l'execution de cette "private sub" tout marche jusqu'a
Range("A9").Select
Ou il me dit que la methode Select de la class range deconne...
Je ne comprends pas car dans la macro seule tout va bien.
Voila mon probleme ( qui est certanement que le premier d'ue longue liste a venir....)
Merci pour votre aide
Je bute depuis maintenant 1 semaine sur une macro.
Je commence par enregistrer une macro puis l'execute. ca marche...
ensuite je recopie le code de cette macro dans une private sub worksheet que voici
Private Sub Worksheet_Change(ByVal target As Range)
Dim i As Integer
Dim Plage As Range, Intersection As Range
Set Plage = Range("B9:B55")
Set Intersection = Application.Intersect(Plage, target)
If Not (Intersection Is Nothing) Then
i = 9
For i = 9 To 55 Step 1
If Cells(i, 8).Value = "OK" Then
If IsNumeric(Cells(i, 7)) Then
If Cells(i, 7).Value < Cells(4, 2).Value Then
Range(Cells(i, 1), Cells(i, 7)).Select
Selection.Copy
Sheets("portefeuille- compte").Activate
Range("A9").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Rows("9:9").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Else
End If
Else
End If
Else
End If
Next i
Cells(1, 1).Select
Selection.Copy
End If
end sub
Lors de l'execution de cette "private sub" tout marche jusqu'a
Range("A9").Select
Ou il me dit que la methode Select de la class range deconne...
Je ne comprends pas car dans la macro seule tout va bien.
Voila mon probleme ( qui est certanement que le premier d'ue longue liste a venir....)
Merci pour votre aide