title: Add a year to a range of values - Excel VBA
body: <p>Im trying to add a year to any value that its added to a column. I dont want to paste to a new column but rather replace values on the same column.</p>
  
  <p>The code ive written so far is:</p>
  
  <pre><code>Private Sub Update_Click()
  
      Application.ScreenUpdating = False
      Application.Calculation = xlCalculationManual
  
      Dim path As String, fileName As String
      Dim lastRowInput As Long, lastRowOutput As Long, rowCntr As Long, lastColumn As Long
      Dim inputWS1 As Worksheet, outputWS As Worksheet
  
      Set inputWS1 = ThisWorkbook.Sheets("Universal")
      Set outputWS = ThisWorkbook.Sheets("Carriers")
  
  
      rowCntr = 1
  
      lastRowInput = inputWS1.Cells(Rows.Count, "A").End(xlUp).Row
      lastRowOutput = outputWS.Cells(Rows.Count, "A").End(xlUp).Row
      lastColumn = inputWS1.Cells(1, Columns.Count).End(xlToLeft).Column
  
      inputWS1.Range("A4:A" &amp; lastRowInput).Copy outputWS.Range("B2")
      inputWS1.Range("B4:B" &amp; lastRowInput).Copy outputWS.Range("C2")
      outputWS.Range("E2:E" &amp; (lastRowInput - 2)).Value = inputWS1.Name
      inputWS1.Range("J4:J" &amp; lastRowInput).Copy outputWS.Range("G2")
      inputWS1.Range("G2:G" &amp; lastRowInput).Value = DateAdd("yyyy", -1, CDate(inputWS1.Range("G2:G" &amp; lastRowInput)))
  
      Application.ScreenUpdating = True
      Application.Calculation = xlCalculationAutomatic 
  
  End Sub
  </code></pre>
  
  <p>The line i need you guys to help me is :</p>
  
  <blockquote>
    <p>DateAdd("yyyy", -1, CDate(inputWS1.Range("G2:G" &amp; lastRowInput)))</p>
  </blockquote>
  
  <p>where inputWS1 is the name of my sheet and lastrowinput is my variable to find the last row on the column. at the time i place this code there is already values on G2 and i just want to transform them into last years date on the same column they are.</p>
  
  <p>Please help</p>