excellentt
XLDnaute Nouveau
Bonjour,
Je voudrais effacer une ligne pointée par une variable (z) et j'ai une erreur. je ne pige pas.
With Sheets("titi")
.Rows("z:z").Delete Shift:=xlUp
End With
Application.CutCopyMode = False
j'ai essayé aussi d'intégré l'enregistrement d'une macro mais sans succes
Range("A10:O10").Select
Selection.Copy
Sheets("histo").Select
Rows("9:9").Select
Selection.Insert Shift:=xlDown
Sheets("portefeuille- compte").Select
Rows("10:10").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
End Sub
sinon voila le code entier de la sub
Private Sub Worksheet_Calculate()
Dim flag As Boolean
Dim z As Integer
If flag = True Then Exit Sub
flag = True
Application.EnableEvents = False
With Sheets("portefeuille- compte")
For z = 10 To 55 Step 1
If .Cells(z, 15).Value = "VENTE" Then
.Range(.Cells(z, 1), .Cells(z, 15)).Copy
Sheets("histo").Range("A9").PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets("histo").Rows("9:9").Insert Shift:=xlDown
With Sheets("portefeuille- compte")
.Rows("z:z").Delete Shift:=xlUp
End With
Application.CutCopyMode = False
Else
If .Cells(z, 15).Value = "FIN" Then
Exit Sub
End If
End If
Next z
End With
flag = False
Application.EnableEvents = True
End Sub
dur dur...
Je voudrais effacer une ligne pointée par une variable (z) et j'ai une erreur. je ne pige pas.
With Sheets("titi")
.Rows("z:z").Delete Shift:=xlUp
End With
Application.CutCopyMode = False
j'ai essayé aussi d'intégré l'enregistrement d'une macro mais sans succes
Range("A10:O10").Select
Selection.Copy
Sheets("histo").Select
Rows("9:9").Select
Selection.Insert Shift:=xlDown
Sheets("portefeuille- compte").Select
Rows("10:10").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
End Sub
sinon voila le code entier de la sub
Private Sub Worksheet_Calculate()
Dim flag As Boolean
Dim z As Integer
If flag = True Then Exit Sub
flag = True
Application.EnableEvents = False
With Sheets("portefeuille- compte")
For z = 10 To 55 Step 1
If .Cells(z, 15).Value = "VENTE" Then
.Range(.Cells(z, 1), .Cells(z, 15)).Copy
Sheets("histo").Range("A9").PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets("histo").Rows("9:9").Insert Shift:=xlDown
With Sheets("portefeuille- compte")
.Rows("z:z").Delete Shift:=xlUp
End With
Application.CutCopyMode = False
Else
If .Cells(z, 15).Value = "FIN" Then
Exit Sub
End If
End If
Next z
End With
flag = False
Application.EnableEvents = True
End Sub
dur dur...