Bonjour a tous,
Le code suivant fonctionne, mais j aimerais qu'il s'execute seulement si les celulles de ma colonne "N" du workbook "stock" = "Y"
Merci par avance a vous pour votre aide.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 Sub position() Dim ws As Worksheet, rng As Range, x As Long, temp Set ws = Workbooks("Wk49production").Sheets("packing production schedule") Set rng = Workbooks("Stocks").Worksheets("wms_browse").Range("D2:Q2000") For x = 1 To 1000 With ws.Cells(x, 5) temp = Application.VLookup(ws.Cells(x, 35), rng, 14, False) If .Comment Is Nothing Then .AddComment CStr(temp) Else .Comment.Text CStr(temp) End If End With Next End Sub
Partager