Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For some reason this macro doesn't run on workbook open (or if it does it's
not doing what it's suppoed to do). It works fine if manually run through the tools menu, but even though it is written in the ThisWorkbook module, no joy. [note, Cell C1 contains the formula =today()]. The only think I can think is that the =today() formula in Cell C1 hasn't calculated prior to the macro running (as it runs on workbook open) so there is no data to conduct the comparison. If so, how can I incorporate the =today() function in the macro itself and then conduct the textual day comparison, i.e. if today is "Thu" and Cell F28 contains "Thu" then returns MsgBox with text from cell C28. Sub ReminderMessageOnOpening() Dim ReportType As String Dim TodaysDay As String Dim ReportDueDay As String Dim i As Integer For i = 28 To 33 If ThisWorkbook.Sheets("Instructions").Range("C" & i) < "" And ThisWorkbook.Sheets("Instructions").Range("F" & i) < "" Then TodaysDay = Format(ThisWorkbook.Sheets("Instructions").Range(" C1"), "ddd") ReportDueDay = ThisWorkbook.Sheets("Instructions").Range("F" & i) ReportType = ThisWorkbook.Sheets("Instructions").Range("C" & i) If ReportDueDay = TodaysDay Then MsgBox ("REMINDER ..... REMINDER ..... REMINDER " & vbNewLine & ReportType & " due " & ReportDueDay) End If End If Next i End Sub Any help appreciated! Thanks, Nick |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2003 - Keep a Macro Running While the Workbook is Open | Excel Programming | |||
Running a macro in a open as read-o Workbook | Excel Programming | |||
Running a macro in a open as read-o Workbook | Excel Programming | |||
Running a macro in a open as read-o Workbook | Excel Programming | |||
Application Error when running Macro on Workbook open | Excel Programming |