+ Reply to Thread
Results 1 to 9 of 9

POP UP message creation

Hybrid View

arnab0711 POP UP message creation 02-23-2010, 03:17 AM
DonkeyOte Re: POP UP message creation 02-23-2010, 05:08 AM
arnab0711 Re: POP UP message creation 02-23-2010, 07:21 AM
DonkeyOte Re: POP UP message creation 02-23-2010, 07:26 AM
arnab0711 Re: POP UP message creation 02-23-2010, 08:16 AM
D_Rennie Re: POP UP message creation 02-23-2010, 10:18 AM
arnab0711 Re: POP UP message creation 02-23-2010, 11:59 AM
DonkeyOte Re: POP UP message creation 02-23-2010, 12:02 PM
arnab0711 Re: POP UP message creation 02-23-2010, 12:44 PM
  1. #1
    Forum Contributor
    Join Date
    02-11-2008
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    242

    POP UP message creation

    Hi All,
    I want to create a pop up message showing count of cells turned red,each time the workbooked are opened.like column "I" has two dates in red colour,so the pop up will say
    "you have 2 contracts expired"
    Attached Files Attached Files
    Last edited by arnab0711; 02-23-2010 at 12:48 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: POP UP message creation

    Given the "red cells" simply equate to count of Today I would suggest you run a COUNTIF (of Date / Today() pending which route you take) via the Open Event against whichever ranges are of interest.

  3. #3
    Forum Contributor
    Join Date
    02-11-2008
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    242

    Re: POP UP message creation

    I am not able to do that,can you help me please

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: POP UP message creation

    Well it's not clear if you need to test multiple ranges or just Column I on KolWB sheet but in the most basic of terms:

    Private Sub Workbook_Open()
    MsgBox Sheets("KolWB").Evaluate("COUNTIF(I:I,TODAY())")
    End Sub
    the above would reside in ThisWorkbook object in VBEditor.

  5. #5
    Forum Contributor
    Join Date
    02-11-2008
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    242

    Re: POP UP message creation

    Thanks for the reply,but the only thing I want is on file open,the comment should be shown,and the comment will be "the # of contracts expired are contract #"

  6. #6
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: POP UP message creation

    hello,

    I think What DO has suggested may be the simplest solution and doesnot over complacate things.

    You could try either of these. You can only have one Private Sub Workbook_Open() in the workbook at a time.
    Private Sub Workbook_Open()
    Dim Count As Long
    Count = Sheets("KolWB").Evaluate("COUNTIF(I:I,TODAY())")
    If Count < 0 Then MsgBox "you have " & .Evaluate("COUNTIF(I:I,TODAY())") & " contracts expired"
    End Sub
    
    Private Sub Workbook_Open()
    Dim Rng As Range
    Dim Rw As Range
    On Error Resume Next
    With Application
        .ScreenUpdating = False
        .EnableEvents = False
            With Sheets("KolWB")
                .UsedRange.AutoFilter Field:=9, Criteria1:=xlFilterToday, Operator:=xlFilterDynamic
                Set Rng = .AutoFilter.Range.Offset(1, 0).Resize(.Cells(.Rows.Count, "A").End(xlUp).Row, .Cells(2, .Columns.Count).End(xlToLeft).Column) _
                        .SpecialCells(xlCellTypeVisible)
                If Rng <> "" Then
                For Each Rw In Rng
                     MsgBox ("Contract " & .Cells(Rw.Row, 1) & " Have Expired"): 'or remove this line and use the next
                     '.Cells(Rw.Row, 1).Interior.Color = 65535
                    Next Rw
                    'MsgBox "you have " & Evaluate("COUNTIF(I:I,TODAY())") & " contracts expired"
                End If
                .AutoFilterMode = False
            End With
        .ScreenUpdating = True
        .EnableEvents = True
    End With
    On Error GoTo 0
    End Sub
    Take a look and try the suggested highlighting and simgle msgbox

    hope this helps

    cheers


  7. #7
    Forum Contributor
    Join Date
    02-11-2008
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    242

    Re: POP UP message creation

    Hi,I am getting this error "Invalid or unqualified reference" on first formula
    and nothing is happening in the second formula

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: POP UP message creation

    The first code should just be:

    Private Sub Workbook_Open()
    Dim Count As Long
    Count = Sheets("KolWB").Evaluate("COUNTIF(I:I,TODAY())")
    If Count Then MsgBox "you have " & Count & " contracts expired"
    End Sub

  9. #9
    Forum Contributor
    Join Date
    02-11-2008
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    242

    Re: POP UP message creation

    Thanks,its working now

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1