title: Trying to verify date on sheet1 in one cell with 30 columns on sheet 2 once verified with vba data pastes under date in sheet2
body: <p>I work for a local company that uses antiquated systems relying on much manual data entry.  Trying to ease the pain with some faster capabilities using excel vba and formulas.  I've built a spreadsheet filled with formulas and vba buttons.  I'm literally on the last part and have been stuck now for at least 2 weeks.  Time is now running out and I'm hoping for some assistance.</p>
  
  <p>Spreadsheet has 2 sheets named "Sheet1" and "Sheet2". On Sheet1 I use a button to concatenate and move data into one cell which is L11.  In L8 I have a constant changing date, day by day.  The data entry works like this: I enter data for April 11th and then change the date in L8 to April 14th (could be any day, just using 14 as an example) to enter the next set of data.  On Sheet2 I have each column labeled by days in the month, i.e. Column A = 1-Apr, Column B = 2-Apr, Column C = 3-Apr, etc.... to the end of the month 30 or 31 which equals Column AD or AE. </p>
  
  <p>What I'd like for the code to do is move the data from cell L11 on sheet1, based on the date in L8 on sheet1, the data moves from sheet1 to sheet2 under the corresponding date. So the click of a button, the macro/vba code finds the date on sheet2 and looks for the date in L8 sheet1 and says:
      "I see a date of 17-Apr in L8, what data exists in cell L11 on sheet1? Ahhh ok.. there is data in L11 sheet1.  I will go ahead and take that data from L11 and paste it in column 17(column Q) in the next available slot below.  Then I will make sure the data is removed from Sheet1 and put the user back on Sheet1 ready to be used again."</p>
  
  <p>Please keep in mind that the data that exists in L8 sheet1 (the date) contains a vlookup formula.  If that is not needed, I'll gladly take other ideas on matching dates.  Or for that matter any other ideas that are better than what you see above and below I'm always open to suggestions.  Also, the button I use to concatenate data that ultimately ends up in cell L11 sheet1 is a recorded macro.  Basically I recorded copying specific cells and pasting them together in one cell and then inserted a single cell that pushes the concatenated data down one cell so that I could enter more than one set of data.</p>
  
  <p>This is the most recent code I've been working on.  When I used the loops for i and j, the code did not error out, however it didn't do anything when running.  I recently tried adding k and m, but the wall I'm hitting just won't budge.  Help please...</p>
  
  <pre><code>Sub senddatatosheet2()
      Dim i As Long, j As Long, lastrow1 As Long, lastrow2 As Long
      Dim mydate As String
      lastrow1 = Sheets("sheet1").Range("L" &amp; Rows.Count).End(xlUp).Row
  
      For i = 8 To 8
          For k = 11 To 11
              mydate = Sheets("sheet1").Cells(i, "L").Value
  
              Sheets("Sheet2").Activate
              lastrow2 = Sheets("Sheet2").Range("A" &amp; Rows.Count).End(xlUp).Row
  
              For j = 1 To lastrow2
                  For m = 2 To lastrow2
                      If Sheets("sheet2").Range(Cells(j, "A")).Value = mydate Then
                          Sheets("Sheet1").Activate
                          Sheets("Sheet1").Range(Cells(11, "L")).Copy
                          Sheets("Sheet2").Activate
                          Sheets("Sheet2").Range(Cells(j, "A"), Cells(j, "AD")).Select
                          ActiveSheet.Paste
                      End If
                  Next j
              Next m
  
              Application.CutCopyMode = False
          Next i
      Next k
  
      Sheets("Sheet1").Activate
      Sheets("sheet1").Range("A1").Select
  End Sub
  </code></pre>