Hi, excelxx. Thank you for helping me with the code. But i i have another problem. i have the "Event Date Year" and "Event Date Month" here which is something like customer forcast. And in column "I" there is "Month Refresh". what i want is that any current year(2010) month is past compare with the "Month Refresh", the Quantiti Sum should be deleted. I wrote code like this, but cannot work. Please help me modify it if there is any mistakes. there is attachmentbelow and the format is fixed. only the Month Refresh and Quantity Sum will be changed. Greatly appreciated!
Dim RefreshMon As Integer
Dim EventMon As Integer
For Each ce In Range("B4:B" & Cells(Rows.Count, "B").End(xlUp).Row)
EventMon = DateValue(ce.Offset(0, 5).Value)
RefreshMon = DateValue(ce.Offset(0, 7).Value)
If DateValue(RefreshMon) - DateValue(EventMon) > 0 Then
ce.Offset(0, 6).Delete
End If
Next ce
Bookmarks