+ Reply to Thread
Results 1 to 5 of 5

Reminding On Due Date

  1. #1
    Forum Contributor
    Join Date
    09-02-2010
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    283

    Reminding On Due Date

    Hi All,

    Hope someone can help me on this.
    I got this script from somewhere, but understand this script is only for Sheet1.
    My workbook consists of Sheet1, Sheet2, Sheet3, Sheet4, Email Add & etc.
    I would like to apply this macro for Sheet1 to 4. How should I modify?

    TIA


    Option Explicit
    Sub Auto_Open()

    Dim LRow As Integer
    Dim LResponse As Integer
    Dim LName As String
    Dim LDiff As Integer
    Dim LDays As Integer
    Dim LInvoice As String 'lc number
    Dim LDd As String
    Dim LPic As String


    LRow = 6

    Dim MaxRowNumber As Integer

    MaxRowNumber = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row

    'Warning - Number of days to check for expiration
    LDays = -3

    While LRow < MaxRowNumber

    'Check the data in column C
    If IsError(Worksheets("Sheet1").Range("T" & LRow).Value) Then
    Else
    'Only check for expired certificate if value in column T is not blank
    If Len(Worksheets("Sheet1").Range("T" & LRow).Value) > 1 Then


    LDiff = DateDiff("d", Date, Worksheets("Sheet1").Range("T" & LRow).Value)
    If (LDiff < LDays) And Len(Worksheets("Sheet1").Range("Y" & LRow).Value) < 1 Then
    'Get subcontractor name
    LName = Worksheets("Sheet1").Range("A" & LRow).Value
    LInvoice = Worksheets("Sheet1").Range("G" & LRow).Value
    LDd = Worksheets("Sheet1").Range("T" & LRow).Value
    LPic = Worksheets("Sheet1").Range("E" & LRow).Value
    LResponse = MsgBox("Invoice No: " & LInvoice & ", Customer: " & LName & " is due to payment on " & LDd & " days." & vbCrLf & "PIC: " & LPic & "" & vbCrLf & "Please make sure payment in!! ", vbCritical, "Warning")
    End If
    End If
    End If
    LRow = LRow + 1
    Wend
    ' MsgBox "No Over Due Found! " & vbCrLf & "Payment Received In Time *\(^_^)/* "

    End Sub
    Last edited by cyee; 07-10-2015 at 05:32 AM. Reason: Modify code

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,617

    Re: Reminding On Due Date

    Try:
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    09-02-2010
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    283

    Re: Reminding On Due Date

    Hi Kaper,

    Thank for your code.
    It work perfectly if I change my sheet name to Sheet1, Sheet2 & etc with the name start with "Sheet"
    However, my sheet name is actually unique.
    May I know how to modify the sheet name in your code?

    I hereby attached the sample. Hope to hear from you soon

    TIA
    Attached Files Attached Files

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,617

    Re: Reminding On Due Date

    For instance:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    09-02-2010
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    283

    Re: Reminding On Due Date

    Woah!!! It Work!!! Thank you very much!!!!

+ 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. Counting if data falls on date between Start Date, End Date or Possible End Date
    By JessHasQuestions in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 07-26-2014, 08:01 AM
  2. Replies: 1
    Last Post: 10-02-2012, 02:42 PM
  3. Replies: 1
    Last Post: 09-28-2012, 08:52 AM
  4. Replies: 7
    Last Post: 11-16-2008, 05:48 PM
  5. Reminding me by e-mail?
    By vandewc in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-18-2006, 03:38 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