請問cells(欄,列) 正確嗎?
因資料都在同1SHEET,怎麼讓38欄提醒過的資料"移動"到別欄呢? 不然會重複提醒已經過去的資料!!
目前程式碼是只提醒當天的,但有時可能休假是隔天開啟這個檔案,就需要將欄位移動到別欄,因是使用超連結的無法複製聯結會跑掉
Sub 當日到期提醒()
For i = 4 To Cells(3, 2).End(xlDown).Row 'Sheets("客戶明細").UsedRange.Rows.Count
If (Sheets("客戶明細").Cells(i, 38).Value = Date) Then
MsgBox (Sheets("客戶明細").Cells(i, 4).Value & "該餐單已到期,請抽單")
Sheets("客戶明細").Cells(i, 45).Value = "已止餐"
If (Day(Data) = Day(Sheets("客戶明細").Cells(i, 38).Value)) Then
MsgBox (Sheets("客戶明細").Cells(i, 38).Value & "該餐單已到期,請抽單")
End If
Else
Sheets("客戶明細").Cells(i, 45).Value = "用餐中"
End If
Next i
End Sub |