Carolinebd
XLDnaute Nouveau
Bonjour
Je suis débutante dans le VBA et j'ai créer ce macro. dans excel 2007
Par contre, la copie fonctionne mais lorsque je rajoute les "if" cela ne fonctionne plus
Sub LACEY()
Dim Source As Worksheet
Dim target As Worksheet
' Change worksheet designations as needed
Set Source = ActiveWorkbook.Worksheets("Shipping List")
Set Tarket = ActiveWorkbook.Worksheets("LACEY")
' Only if they have a number in the cell
If Worksheets("Shipping List").Range("N12:N1519").Value > 0 Then
Also
' Only need lacey active, DO NOT COPY if cell indicate "N/A"
If Worksheets("Shipping List").Cells("E12:E1519") = ("CAP" Or "USA" Or "SPF" Or "LAM" Or LVL) Then
'Range.Copy Shipping list to Lacey
Worksheets("Shipping List").Range("H12:H1519").Copy Worksheets("LACEY").Range("C16")
Worksheets("Shipping List").Range("I12:I1519").Copy Worksheets("LACEY").Range("D16")
Worksheets("Shipping List").Range("E12:E1519").Copy Worksheets("LACEY").Range("B16")
'Multiply Worksheets("Shipping List").Range("I12:I1519") by Worksheets("Shipping List").Range("N12:N1519")
End If
End Sub
Je suis débutante dans le VBA et j'ai créer ce macro. dans excel 2007
Par contre, la copie fonctionne mais lorsque je rajoute les "if" cela ne fonctionne plus
Sub LACEY()
Dim Source As Worksheet
Dim target As Worksheet
' Change worksheet designations as needed
Set Source = ActiveWorkbook.Worksheets("Shipping List")
Set Tarket = ActiveWorkbook.Worksheets("LACEY")
' Only if they have a number in the cell
If Worksheets("Shipping List").Range("N12:N1519").Value > 0 Then
Also
' Only need lacey active, DO NOT COPY if cell indicate "N/A"
If Worksheets("Shipping List").Cells("E12:E1519") = ("CAP" Or "USA" Or "SPF" Or "LAM" Or LVL) Then
'Range.Copy Shipping list to Lacey
Worksheets("Shipping List").Range("H12:H1519").Copy Worksheets("LACEY").Range("C16")
Worksheets("Shipping List").Range("I12:I1519").Copy Worksheets("LACEY").Range("D16")
Worksheets("Shipping List").Range("E12:E1519").Copy Worksheets("LACEY").Range("B16")
'Multiply Worksheets("Shipping List").Range("I12:I1519") by Worksheets("Shipping List").Range("N12:N1519")
End If
End Sub