Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Pop Up Form Within selection of sheet Hi, I have currently acquired this macro t

ID: 3560798 • Letter: P

Question

Pop Up Form Within selection of sheet

Hi,

I have currently acquired this macro that is pops up when I open the workbook, it's like a reminder that advices me any to do list that will be due on tomorrow. How could this be adjusted so that instead it searches "Au3:Au365" it only searches in one cell "J5" and it advices me that if that cells is equal to the number zero pop up form appears "so that transactions can be archived". Also if it is possible within the macro below it opens exactly when the workbook opens could this be adjusted if i select the worksheet and then the pop up appears.

Thanks

Private Sub Workbook_Open()


Sheets("Bank book 1").Activate
Dim dt As Date
dt = DateSerial(Year(Now()), Month(Now()), Day(Now()))
Set rng = Range("au3:au365").Find(what:=dt + 1, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If rng Is Nothing Then
' do nothing
Else
If rng.Cells.Offset(0, -4) <> "" Then MsgBox "Tomorrow " & rng.Offset(0, -4).Value
End If
End Sub

Explanation / Answer

*In the code module of the worksheet of interest, replace the existing code with the following version:;'@

'=========>>
Option Explicit

'--------->>
Private Sub Worksheet_Activate()
    Dim Rng As Range
    Const myCell As String = "J5"

    Set Rng = Me.Range(myCell)

    If Rng.Value = 0 Then
        Call MsgBox(Prompt:="All transactions can be archived", _
                    Buttons:=vbInformation, _
                    Title:="ARCHIVE TRANSACTIONS!")
    End If
End Sub
'<<=========