gpt-4o-mini-2024-07-18· OpenAI
WildChat-4.8M (AI2)
Please help to correct and complete: Sub ShowExpiredTasks() Dim ws As Worksheet Dim…
- User
Please help to correct and complete: Sub ShowExpiredTasks()
codeDim ws As Worksheet Dim lastRow As Long, i As Long Application.EnableEvents = False Application.ScreenUpdating = False For Each ws In ThisWorkbook.Worksheets 'If ws.Name Like "Day*Week*Fortnight*Month*QtrYear*HalfYear*Year" Then If ws.Name = "Day" Or ws.Name = "Week" Or ws.Name = "Fortnight" Or ws.Name = "Month" Or ws.Name = "QtrYear" Or ws.Name = "HalfYear" Or ws.Name = "Year" Then ' Unprotect the current worksheet ws.Unprotect Password:="edit" lastRow = ws.Cells(Rows.Count, "G").End(xlUp).row For i = 2 To lastRow If ws.Cells(i, "G").Value < Date ThenWrite to a MsgBox into rows the following format: ws Column A value, ws Column G value, ws Sheet Name
code' Protect the current worksheet after processing ws.Protect Password:="edit" End If Next ws Application.ScreenUpdating = True Application.EnableEvents = TrueEnd Sub
- Assistant