Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a macro to send an automated email when passwords need renewing. This
all works fine, but what i want to do is set up another macro to run automatiocally at 00:00:01 to check if any passwords need changing. What i have so far is this:- Sub CheckDay() Application.OnTime TimeValue("17:00:00"), "my_Procedure" Range("D7:D30").Select If Range = 5 Then Sub SendEmail() Else End If End Sub So what i want is if a cell in range D7 - D30 is 5 then sub the macro SendEmail. For some reason it is not workign and i can't work out why. Any help would be much appreiciated. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
Try this Sub CheckDay() Application.OnTime TimeValue("17:00:00"), "my_Procedure" For Each c In Range("D7:D30") If c.Value = 5 Then Call SendEmail End If Next End Sub Mike "Dan Wood" wrote: I have a macro to send an automated email when passwords need renewing. This all works fine, but what i want to do is set up another macro to run automatiocally at 00:00:01 to check if any passwords need changing. What i have so far is this:- Sub CheckDay() Application.OnTime TimeValue("17:00:00"), "my_Procedure" Range("D7:D30").Select If Range = 5 Then Sub SendEmail() Else End If End Sub So what i want is if a cell in range D7 - D30 is 5 then sub the macro SendEmail. For some reason it is not workign and i can't work out why. Any help would be much appreiciated. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Genius!!
Worked first time. Thank you "Mike H" wrote: Hi, Try this Sub CheckDay() Application.OnTime TimeValue("17:00:00"), "my_Procedure" For Each c In Range("D7:D30") If c.Value = 5 Then Call SendEmail End If Next End Sub Mike "Dan Wood" wrote: I have a macro to send an automated email when passwords need renewing. This all works fine, but what i want to do is set up another macro to run automatiocally at 00:00:01 to check if any passwords need changing. What i have so far is this:- Sub CheckDay() Application.OnTime TimeValue("17:00:00"), "my_Procedure" Range("D7:D30").Select If Range = 5 Then Sub SendEmail() Else End If End Sub So what i want is if a cell in range D7 - D30 is 5 then sub the macro SendEmail. For some reason it is not workign and i can't work out why. Any help would be much appreiciated. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Glad I could help and thanks for the feedback
"Dan Wood" wrote: Genius!! Worked first time. Thank you "Mike H" wrote: Hi, Try this Sub CheckDay() Application.OnTime TimeValue("17:00:00"), "my_Procedure" For Each c In Range("D7:D30") If c.Value = 5 Then Call SendEmail End If Next End Sub Mike "Dan Wood" wrote: I have a macro to send an automated email when passwords need renewing. This all works fine, but what i want to do is set up another macro to run automatiocally at 00:00:01 to check if any passwords need changing. What i have so far is this:- Sub CheckDay() Application.OnTime TimeValue("17:00:00"), "my_Procedure" Range("D7:D30").Select If Range = 5 Then Sub SendEmail() Else End If End Sub So what i want is if a cell in range D7 - D30 is 5 then sub the macro SendEmail. For some reason it is not workign and i can't work out why. Any help would be much appreiciated. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Just two more quick (hopefully) questions:-
1 - I have the macro to ceate the email and input all the required details, but can't get it to actually send. Is there an extra line i need at the bottom to actually send? 2 - Can i get these macro's to run even if the sheet isn't open? From what i have found i don't think i can, but the point of the spreadsheet is to alert users when there passwords ar edue to expire, so in a perfect world it would run every day shortly after midnight. Thanks "Mike H" wrote: Glad I could help and thanks for the feedback "Dan Wood" wrote: Genius!! Worked first time. Thank you "Mike H" wrote: Hi, Try this Sub CheckDay() Application.OnTime TimeValue("17:00:00"), "my_Procedure" For Each c In Range("D7:D30") If c.Value = 5 Then Call SendEmail End If Next End Sub Mike "Dan Wood" wrote: I have a macro to send an automated email when passwords need renewing. This all works fine, but what i want to do is set up another macro to run automatiocally at 00:00:01 to check if any passwords need changing. What i have so far is this:- Sub CheckDay() Application.OnTime TimeValue("17:00:00"), "my_Procedure" Range("D7:D30").Select If Range = 5 Then Sub SendEmail() Else End If End Sub So what i want is if a cell in range D7 - D30 is 5 then sub the macro SendEmail. For some reason it is not workign and i can't work out why. Any help would be much appreiciated. |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
One more question. If i want the email to specify which system needs the new
password how would i do this? Currently the email just has some text to say your password needs resetting. The example of the sheet would be the systems in colum A, in colum B has whether the password has expired. Therefore i would want the macro to run and say systems A3, A6 and A9 for example have expired? If this is very compicated it doesn't matter to much. Thanks again "Dan Wood" wrote: Just two more quick (hopefully) questions:- 1 - I have the macro to ceate the email and input all the required details, but can't get it to actually send. Is there an extra line i need at the bottom to actually send? 2 - Can i get these macro's to run even if the sheet isn't open? From what i have found i don't think i can, but the point of the spreadsheet is to alert users when there passwords ar edue to expire, so in a perfect world it would run every day shortly after midnight. Thanks "Mike H" wrote: Glad I could help and thanks for the feedback "Dan Wood" wrote: Genius!! Worked first time. Thank you "Mike H" wrote: Hi, Try this Sub CheckDay() Application.OnTime TimeValue("17:00:00"), "my_Procedure" For Each c In Range("D7:D30") If c.Value = 5 Then Call SendEmail End If Next End Sub Mike "Dan Wood" wrote: I have a macro to send an automated email when passwords need renewing. This all works fine, but what i want to do is set up another macro to run automatiocally at 00:00:01 to check if any passwords need changing. What i have so far is this:- Sub CheckDay() Application.OnTime TimeValue("17:00:00"), "my_Procedure" Range("D7:D30").Select If Range = 5 Then Sub SendEmail() Else End If End Sub So what i want is if a cell in range D7 - D30 is 5 then sub the macro SendEmail. For some reason it is not workign and i can't work out why. Any help would be much appreiciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I use wildcards in IF statements and Macros | Excel Discussion (Misc queries) | |||
Excel 2007 macros - how to merge 5 macros together into one | Excel Discussion (Misc queries) | |||
IF Statements (Mutliple Statements) | Excel Worksheet Functions | |||
Training: More on how to use macros in Excel: Recording Macros | Excel Worksheet Functions | |||
How do i start Macros using IF statements? | Excel Discussion (Misc queries) |