Mr.G
05-28-2007, 08:19 AM
I'm having problems running a "if" statement for a cell.Well I don't even know if I'm doing it correctly. Here is what I would like to do.......
If cell A3 is = or < than a 1000 run macro mail. And it should notify me. Also the cell changes colour with conditional formatting so when I need to update I'll just look for the coloured cells.
Public sub()
'on the sheet
If Range(A3) <= 1000 Then
Call Mail
End sub
Then the Macro:
Public Sub Mail()
Dim myOutlook As Object
Dim myMailItem As Object
Set myOutlook = CreateObject("Outlook.Application")
Set myMailItem = myOutlook.createitem(0)
myMailItem.Recipients.Add "B@yahoo.com"
myMailItem.Recipients.Add "A@yahoo.com"
myMailItem.Subject = "Update"
myMailItem.body = "Please update"
myMailItem.send
Set myOutlook = Nothing
End Sub
Your help would be appreciated.
Thank you
If cell A3 is = or < than a 1000 run macro mail. And it should notify me. Also the cell changes colour with conditional formatting so when I need to update I'll just look for the coloured cells.
Public sub()
'on the sheet
If Range(A3) <= 1000 Then
Call Mail
End sub
Then the Macro:
Public Sub Mail()
Dim myOutlook As Object
Dim myMailItem As Object
Set myOutlook = CreateObject("Outlook.Application")
Set myMailItem = myOutlook.createitem(0)
myMailItem.Recipients.Add "B@yahoo.com"
myMailItem.Recipients.Add "A@yahoo.com"
myMailItem.Subject = "Update"
myMailItem.body = "Please update"
myMailItem.send
Set myOutlook = Nothing
End Sub
Your help would be appreciated.
Thank you