+ Reply to Thread
Results 1 to 3 of 3

Automated email coding

  1. #1
    Registered User
    Join Date
    01-14-2010
    Location
    West Virginia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Automated email coding

    All,
    Below is a copy of the code that I am using to try to automatically send an email to a list of people if any value between I14 and l:400 meets or exceeds the value in F10. I am very close to getting it to work, as it will send an email if I14 exceeds F10, but if the first time the value exceeds is past I14 it will not send the email. I have a For loop in it which will work if I remove the exit for statement, but then I get 386 emails. Clearly, that is not what I want. I have very limited programming knowledge and would love some assistance on this. Thanks

    Please Login or Register  to view this content.
    Last edited by netgame27; 01-19-2010 at 09:54 AM.

  2. #2
    Registered User
    Join Date
    01-14-2010
    Location
    West Virginia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Automated email coding

    Fixed, do you have any information that can help?

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Automated email coding

    I've had a quick look just now... though some of the code is using older methods (and some elements aren't really required) I can't see any stand out code reason (other than the spurious Exit For at the end of the Mailing routine) as to why your code is not doing as you expect...

    I think then the focus should therefore really be concentrated upon:

    Please Login or Register  to view this content.
    If as implied by the name, MaxOutTime is meant to represent a Time Value of some sort then yes that could potentially cause issues given the variable is Declared as an Integer.

    Time in XL is Decimal... the Integer declaration will result in a value of either 0/1 for all Time Value entered into F10 - 0 where <= noon, 1 where > noon.

    So it follows that if the contents of I14:I400 are also Time values and that F10 is <= noon then all of these values will indeed be greater than MaxOutTime (0) and hence the emails are issued.

    If you believe that's a possibility change MaxOutTime variable type from Integer to Double.


    If in doubt post a sample of your OUTTIME LOG so we can see the data type - we need only see the values in F10, I14:I400 - all other values can be removed.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1