Hi all,
I have a sheet ("Uplifts") with daily entries.
CallDate UpliftNumber CallNumber CPC Size Category Reason
17-Aug-15 51002247 4645778 5P1204 Pallet Picking Error Operator Error
18-Aug-15 51002293 4674543 5P1300 Case Picking Error Operator Error
I am trying to pick out any entries with today's date in column A and paste them into another sheet ("Temp"). I can't work out where this code is wrong, as it picks up the source sheet headers in Row 1 and pastes that, but not the corresponding entry from Row 3 which matches today's date. So my resulting code pastes just this in ("Temp"):
CallDate UpliftNumber CallNumber CPC Size Category Reason
Here's the code:
Private Sub UserForm_Initialize()
Me.TodayDate = Date
Sheets("Temp").Select
Sheets("Temp").Cells.ClearContents
Dim ValueToSearch As Date, LR As Integer, LC As Integer, Counter As Integer
Sheets("Temp").Range("A1").CurrentRegion.ClearContents
Sheets("Uplifts").Select
ActiveSheet.AutoFilterMode = False
ValueToSearch = CDate(TodayDate.Value)
LR = Sheets("Uplifts").Cells(Rows.Count, 1).End(xlUp).Row
ActiveSheet.Range(Cells(1, 1), Cells(LR, 4)).AutoFilter Field:=1, Criteria1:=ValueToSearch
Range(Range("A1"), ActiveCell.SpecialCells(xlLastCell)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy Sheets("Temp").Range("A1")
ActiveSheet.AutoFilterMode = False
Range("A1").Select
End Sub
Any help or direction appreciated!
Pete
Bookmarks