title: Paste data into into correct date column in a different worksheet
body: <p>I have a workbook which is updated daily and a copy of that workbook is saved as that date. What I am looking to do is have a sheet with a column for each date of the year and save the data into the correct date column in order to have a daily record and a running total.</p>
  
  <p>I used the IF function and it works great except when you change the date the previous column date is not saved. I think I will need a macro for this but don't know where to start.</p>
  
  <p>Thanks in advance for your help!</p>
  
  <p>Here is my code:</p>
  
  <pre><code>Sub KPI()
  
  Dim lct As Long 
  lct = Application.WorksheetsFunction.Match(Worksheets("KPI").Range("A1"), Worksheets("KPI").Range("H2:BP2"), 0) 
  
  Worksheets("Shift Summary").Activate 
  Range("F15").Select 
  
  If Range("A4") = "I2" Then 
  
      Worksheets("KPI").Activate Cells(lct, 3).Select 
          Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ 
          :=False, Transpose:=False 
  
  End If 
  
  If Range("A4") = "J2" Then 
  
      Worksheets("KPI").Activate Cells(lct, 21).Select Selection.PasteSpecial         Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False 
  End If 
  
  End Sub
  </code></pre>