Hello,
I'm pulling data from a CSV file. The CSV file has a "Quantity" column that contains the absolute value of the quantity. I want to add a new "Qty" column and an if statement to say if certain criteria is met, make the value negative.
Here's what I have so far from the recorder... weirdly, this works on one spreadsheet and not another when referencing the same data... how can I make this better and more dynamic?
I'm pulling data from a CSV file. The CSV file has a "Quantity" column that contains the absolute value of the quantity. I want to add a new "Qty" column and an if statement to say if certain criteria is met, make the value negative.
Here's what I have so far from the recorder... weirdly, this works on one spreadsheet and not another when referencing the same data... how can I make this better and more dynamic?
Code:
Range("W1").Select
ActiveCell.FormulaR1C1 = "Qty"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-24]=""B"",RC[-23],RC[-23]*-1)"
Selection.AutoFill Destination:=ActiveCell.Range("A1:A" & finalRow)