title: VBA code to insert column and formula
body: <p>I have a file where I need to delete certain columns. I then need to insert a column called 'positive values' and add a formula so that only the positive values from another column are picked up in this new column.</p>
  
  <p>So far I have pieced together the following code to delete the columns I do not need, but I am stuck at how to insert a new column next to an existing column called "net" and then have this column only show the positive values from column net in the relevant cells.</p>
  
  <p><strong>Current code</strong></p>
  
  <pre><code>Sub ArrayLoop()
    Dim ColumnsToRemove As Variant
    Dim vItem As Variant
    Dim A As Range
  
    Sheets("sheet 1").Select
  
    ColumnsToRemove = Array("acronym", "valueusd", "value gbp")
    For Each vItem In ColumnsToRemove
      Set A = Rows(8).Find(What:=vItem, LookIn:=xlValues, lookat:=xlPart)
      Debug.Print vItem, Not A Is Nothing
  
      If Not A Is Nothing Then A.EntireColumn.Delete
    Next
  End Sub
  </code></pre>
  
  <p>Currently I manually insert the new column and enter the formula max(E9,0) so the new column either shows 0 or a value if the value in the other column is greater than 0. Is it possible to automate this part as well.</p>
  
  <p>Thanks in advance.</p>