I am looking for a logic/macro/vba code that will automatically delete certain entries that are older than todays date.
At the moment I collect data using the below code:
Sub upload()
Sheets("Input").Range("C2,C3,C4,C5,C6,C7,C9").Copy
Sheets("Data").Range("C" & Rows.Count).End(xlUp).Offset(1).PasteSpecial _
Paste:=xlPasteValues, Transpose:=True
Sheets("Input").Range("C2:C9").ClearContents
End Sub
The Column C in DATA (Sheet) is the date, Column D is the description that determines that data to be deleted. At the moment I do it manually but would like for it to be automated.
Logic at the moment: IF(LEFT(D2,2)="CS","",I2)
The logic that I was thinking would be better is and embeded in the macro/code: IF(and (LEFT(D2,2)="CS",C2<today),"",I2).
Kindly assist with the code to be embeded with the above macro/vba code.
At the moment I collect data using the below code:
Sub upload()
Sheets("Input").Range("C2,C3,C4,C5,C6,C7,C9").Copy
Sheets("Data").Range("C" & Rows.Count).End(xlUp).Offset(1).PasteSpecial _
Paste:=xlPasteValues, Transpose:=True
Sheets("Input").Range("C2:C9").ClearContents
End Sub
The Column C in DATA (Sheet) is the date, Column D is the description that determines that data to be deleted. At the moment I do it manually but would like for it to be automated.
Logic at the moment: IF(LEFT(D2,2)="CS","",I2)
The logic that I was thinking would be better is and embeded in the macro/code: IF(and (LEFT(D2,2)="CS",C2<today),"",I2).
Kindly assist with the code to be embeded with the above macro/vba code.