VBA Date + For logic
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: can someone help me? It seems my for logic is not working at all because it keeps returning me 12:00AM for starttime Here is my code Sub forlogic() Dim i As Single Dim totalrow As Double Dim startdate As Date Dim mydate As Date totalrow = Sheet1.Range("A1", Sheet1.Range("A1").End(xlDown)).Rows.Count mydate = Date Debug.Print mydate mydate = mydate - 90 Debug.Print mydate For i = 1 To i = rowtotal Step 2 startdate = Format(Range("E" & i).Value, "short date") startdate = Format(Date, "mm/dd/yyyy") If mydate > startdate Then Range("M" & i)