• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro will not start from a cell that changes from a formula

Erlend71

New Member
Hi.
I have used this:

>>> use code - tags <<<
Code:
Dim xRg As Range
Private Sub Worksheet_Change(ByVal Target As Range)
    On Error Resume Next
    If Target.Cells.Count > 1 Then Exit Sub
  Set xRg = Intersect(Range("G5"), Target)
    If xRg Is Nothing Then Exit Sub
    If IsNumeric(Target.Value) And Target.Value < Range("G2") Then
        Call Mail_small_Text_Outlook
    End If
End Sub
If I type in the value i G5, everything works fine, but when the value i G5 changes due to a change in a value that triggs the formula in G5, nothing happens. How to overcome this? Tanks in advance
 
Last edited by a moderator:
Erlend71
You should add address to above Sub which You change ... which change G5-value.
A formula itself won't trigg above Sub.

Thanks for replying. Everything in this sheet are formulas. I have a Microsoft Query that list a lot of data from a SQL-source in sheet 1. In sheet 2 I have som formulas that controls some parametres from sheet 1. I will try to make a sheduled task that ones a day opens excel, update data from the SQL-source. Then, if certain parametres occurs (result of formulas in sheet 2), I want an automatic e-mail. So then I need to pick a value from sheet 1 to trigg it? For example new dates are coming in every date and if I sort it descending, new date in row 2 in sheet 1 can trigg it?
 
Erlend71
You should try to find that kind of Worksheet/-book-function - which activates by Your Query ( I don't use those ).
Could You use eg Workbook_BeforeClose or Worksheet_Activate?
You should solve Yourself - when do You need that an automatic e-mail? ( after what? )
 
Back
Top