Hi all,
I've create the below code which takes the date input from an inputbox as a variable, filters a column based on anything older than that date, selects the filtered criteria and then copy/pastes it to a new sheet and deletes it from the master sheet.
The problem is this criteria won't always reside in the same rows so I am needing to alter my code to make this dynamic, can anyone help me with this or point me in the right direction?
I've create the below code which takes the date input from an inputbox as a variable, filters a column based on anything older than that date, selects the filtered criteria and then copy/pastes it to a new sheet and deletes it from the master sheet.
The problem is this criteria won't always reside in the same rows so I am needing to alter my code to make this dynamic, can anyone help me with this or point me in the right direction?
Code:
[FONT="]
ReEnter: myInputBoxTypeVariable = InputBox(Prompt:="Please enter the Date here") If IsDate(myInputBoxTypeVariable) Then MsgBox "Your input was: " & myInputBoxTypeVariable 'display message box with value held by variable GoTo The_End Else MsgBox "Please try again and enter a date in the format MM/DD/YYYY" GoTo ReEnter End If The_End: 'End of inputbox Range("K2").Select ActiveSheet.Range("$A$1:$S$7736").AutoFilter field:=11, Criteria1:= _ ">myInputBoxTypeVariable", Operator:=xlAnd 'contains the >myInputBoxTypeVariable (Date Selection) Range("A2:S225").Select Selection.Copy Sheets("Exceptions Due to Date-Status").Select Range("A2").Select ActiveSheet.Paste Sheets("Master Purge List").Select Application.CutCopyMode = False Selection.EntireRow.Delete
[/FONT]