• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Message pop ups when todays date maTches in a column

Shayeebur

Member
Hi chandoo,
I have a worksheet in sheet1 in column A contains name and column E contains dates i am looking for macro if a person open this file the message pop up when column E date matches with todays date. The popup msg will be the persons name of the corresponding column e of todays date.
 
Right-click on Sheet tab, view code. This will open the VBE. In the ThisWorkbook module, paste this code:
Code:
Private Sub Workbook_Open()
Dim fCell As Range
'Change sheet name to suit
With Worksheets("Sheet1")
    On Error Resume Next
    Set fCell = .Range("E:E").Find(Date)
    On Error GoTo 0
   
    If Not fCell Is Nothing Then
        MsgBox .Cells(fCell.Row, "A").Value
    End If
End With
End Sub
 
Hi @Shayeebur

check this one, and confirm, if its working for you..

Code:
Private Sub Workbook_Open()
    With Sheets("Sheet1").Range("A1").CurrentRegion
        .AutoFilter 5, xlFilterToday, xlFilterDynamic
        If Range("A1:A" & .Rows.Count).SpecialCells(12).Cells.Count > 1 Then
            For Each cell In .Range("A2:A" & .Rows.Count).SpecialCells(12)
                msg = msg & "-" & cell.Value
            Next cell
        End If
        .AutoFilter
    End With
    If Len(msg) > 2 Then _
        MsgBox "Hello " & Mid(msg, 2)
End Sub
 

Attachments

  • Pop Up Message if date matched.xls
    34 KB · Views: 7
Back
Top