| bonjour à toutes et tous, |
|
| j'ai créé la macro ci dessous : |
| Sub oct() |
| If [as27] = 1 Then |
| [au27].PrintPreview |
| [as27] = "OK" |
| [ao27].Copy |
| [ao27].PasteSpecial Paste:=xlPasteValues |
| [ap27].Copy |
| [ap27].PasteSpecial Paste:=xlPasteValues |
| [am27] = "" |
| [an27] = "" |
| Dim plage As Range |
| Set plage = ThisWorkbook.Worksheets("stock").Range("ag27:ag300") |
| Monchiffre = [ao27] |
| For Each cell In plage |
| If cell.Value = Monchiffre Then |
| cell.Value = 0 |
| End If |
| Next cell |
| Monchiffre = [ap27] |
| For Each cell In plage |
| If cell.Value = Monchiffre Then |
| cell.Value = 0 |
| End If |
| Next cell |
| End If |
| End Sub |
| Elle fonctionne très bien, mais j'ai essayé de faire une boucle de la ligne 27 à la ligne 300 (avec la commande for ), j'ai des erreurs de syntaxe. |
| Je vous remercie d'avance pour votre aide |