Ajouter un code vba a une macro enregistree - debutant

urbanito1

XLDnaute Occasionnel
Salut à la communauté,

j'ai enregistré la macro du fichier joint -

elle fonctionne
j'ai voulu lui ajoindre ce code
( finalisé par Boisgontier )http://www.excel-downloads.com/forum/178704-macro-suppression-de-ligne-avec-une-cellule-contenant-84511-11101-03-a.html


Sub supLignesRapide2()
Application.ScreenUpdating = False
a = Range("W1:W" & [W65000].End(xlUp).Row)
For i = LBound(a) To UBound(a)
If a(i, 1) Like "*84511/11101-03*" Or _
a(i, 1) Like "*84511/11102-03*" Or a(i, 1) Like "*84511/11105-03*" Then a(i, 1) = "sup" Else a(i, 1) = 0
Next i
Columns("b:b").Insert Shift:=xlToRight
[B1].Resize(UBound(a)) = a
[A1].CurrentRegion.Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlGuess
On Error Resume Next
Range("B1:B65000").SpecialCells(xlCellTypeConstants, 2).EntireRow.Delete
Columns("b:b").Delete Shift:=xlToLeft
End Sub

je ne dois pas le faire correctement, il m'affiche code anomalie 1004...certainement mon manque d'expérience

qui pourrait voir le problème ? avec un petit mot d'explication

un grand merci
urbanito1
 

Pièces jointes

  • extraction 4352 année 2012 18 2 2012 COPIE EXEL DOWNLOAD.xlsm
    21.7 KB · Affichages: 54

Discussions similaires

Réponses
13
Affichages
2 K

Statistiques des forums

Discussions
312 348
Messages
2 087 508
Membres
103 568
dernier inscrit
NoS