I have tried so many ways to make this work and its just not! j is the # of tabs its searching through (TailValue is an arraylist.Tested & works). k is the # of rows its supposed to be searching (Starting on Row 2 ending on Row 12). WantedDate is a text box for the date to search.
What I need it to do: Go through each tab. Find any date that matches the WantedDate (Only search Rows A2:A12). Copy the entire row and either paste it or insert it on the 2nd Row of the Mx EOD Tab
Every time I get it to atleast kind of function it pulls a random rows on each tab and/or it pulls the wrong date and inserts it on the MX EOD Tab twice.
If the "If Statement" needs an "Else" (If the date does not match the wanted date) I need it to move to the next row in the range and compare. There can be multiple rows with this date. Thank you for any and all help!!
For j = 0 To 20 'Or to LastRow (Cant figure out how to get the last row with text)
For k = 2 To 15 'Or to LastRow ("")
If Worksheets(TailValue(j)).Cells(k, 1).Value = WantedDate Then
Worksheets(TailValue(j)).Rows(ActiveCell).EntireRow.Copy
Worksheets("Mx EOD").Activate
Rows(2).Insert
End If
Next k
Next j