1
我在寫一個宏,如果範圍包含2016年的任何日期(例如),我想執行一些代碼。我有一個開始(我認爲)。如果範圍包括2016年的日期
Dim rptDateColumn As Range
Set rptDateColumn = Sheets("Data").Range("N:N")
For Each cell In rngRptgDate
If ... (the date is during 2016)... Then
...This other stuff happens
有什麼建議嗎?
的可能的複製(http://stackoverflow.com/questions/24737099/extract-year-from-date [日期從Excel中使用VBA提取物年] -using-vba-in-excel) – Tyeler
您是否想知道N列中的**任何**單元格是42370(2016年1月1日)至42735(2016年12月31日)之間的數字?或**每個**單元格是否在範圍內? – YowE3K