+ Reply to Thread
Results 1 to 2 of 2

popup alert message during the worksheet open and continuous work on the sheet popup jump

  1. #1
    Registered User
    Join Date
    07-18-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    1

    Angry popup alert message during the worksheet open and continuous work on the sheet popup jump

    Sir I want to VBA code for worksheet of excel one column as Column C2 to C10 have a any future date. this Column(C2 to C10) date compare from system date and given popup message before 10 days, 20 days..... as date mention in Column C2 is 14/06/2014 and today system date 04/06/2014 so that difference is 10 days now given the automatic popup message when open the worksheet of excel and this popup message given every 5 mins when worksheet is open, but expire 10 days as column C2 have a date is 03/06/2014 and today is system date is 04/06/2014 then difference is -1 day now given the message is expired the date with remaining 10 days message because some condition are true and some condition are false in the same worksheet of excel. given this code not met two condition one is not popup every 5 secs and second condition is not met -1, -2 etc expired date as given the message should be expired the date before 1 or 2 days etc. so please reply as early. given my vba code below

    Private Sub Workbook_Open()
    Dim Mycell
    Dim Rng
    Dim strText As String
    Dim nTime
    Set Rng = Sheets("Sheet1").Range("C2:C16")
    For Each Mycell In Rng
    If Mycell.Value <= 10 Then
    strText = strText & vbLf & " Due Days " & " = " & Mycell.Offset(0, 0).Value & " " & " Tender Open date" & " = " & Date + Mycell.Value
    End If
    Next Mycell

    If Len(strText) > 0 Then
    nTime = Now + TimeSerial(0, 0, 5) 'every 5 secs
    MsgBox strText & vbLf & "Are Overdue. Take Action Now! ", vbOKOnly Or vbExclamation, "Tasks Overdue"
    End If
    End Sub
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Dim Mycell
    Dim Rng
    Dim strText As String

    Set Rng = Sheets("Sheet1").Range("C2:C16")
    For Each Mycell In Rng
    If Mycell.Value <= 10 Then
    strText = strText & vbLf & " Due Days " & " = " & Mycell.Offset(0, 0).Value & " " & " Tender Open date" & " = " & Date + Mycell.Value

    End If
    Next Mycell

    If Len(strText) > 0 Then
    MsgBox strText & vbLf & "Are Overdue. Take Action Now! ", vbOKOnly Or vbExclamation, "Tasks Overdue"
    End If
    End Sub

    Thanks. Shailendra Singh
    Attached Files Attached Files
    Last edited by shailkam2001; 06-05-2014 at 01:58 AM. Reason: As per forum request

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA code for excel worksheet

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem. Once you have done this please send me a PM and I will remove this request.

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. EXCEL: WorkSheet Or Workbook Code Should Not Run
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2013, 03:59 AM
  2. Worksheet Code Launches Diifferent Worksheet Code - PivotTableUpdate
    By sample57 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-25-2013, 04:33 PM
  3. VBA code for copying a worksheet and pasting it as a new worksheet in Excel
    By eemiller1997 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-27-2012, 11:56 AM
  4. VBA code in Excel effecting other other excel worksheet/ workbook
    By Zeeman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2012, 01:20 PM
  5. MS Excel – VBA – Sorting worksheet - CODE
    By Bernardes in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-23-2008, 08:09 AM

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