(Solved) – Looking for Excel macro to move quantity of a cell into a new cell if a certain value appears in another cell

  • by

I need to run a macro that looks for a range of SKUs in column (A). if it finds one of the SKUs to take the value of column (B) and stick it in column (C), and do that for every entry in the spreadsheet.

I am not much of a coder, so any help would be much appreciated. Below is some code I found that almost does the trick, but I just get a #NAME? result in column (C)

Sub Printer_Quantity()

Dim variable As String
variable = "insert value or cell here"

With Sheets("Plasco BS US BS CAN Direct")
    LR = .Cells(Rows.Count, "A").End(xlUp).Row
    For i = LR To 2 Step -1
        If .Cells(i, "A").Value = "ACL006" Then
            .Cells(i, "C").Value = "=SUM(B)"
        End If
    Next i
End With

End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *