View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Dan Wood Dan Wood is offline
external usenet poster
 
Posts: 49
Default If statements in macros

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.