+ Reply to Thread
Results 1 to 6 of 6

Count If any text is entered for the third time and send Email

  1. #1
    Registered User
    Join Date
    04-09-2020
    Location
    Slovenia
    MS-Off Ver
    2016
    Posts
    16

    Count If any text is entered for the third time and send Email

    Hello,

    i need help with adjusting the following code:

    Please Login or Register  to view this content.
    When the word "Excel" is entered for the third time anywhere in Range A1:T20, the code sends an Email with body:
    Hi there
    The word excel has been entered.
    Please respond.

    I would need to adjust the code, that if ANY TEXT OR WORD is written for the third time, it would send an Email with that word in body.
    For example, if I entered the word "Sun" three times, an Email with following text would be sent:
    Hi there
    The word Sun has been entered.
    Please respond.

    Any suggestions?

    Thank you in advance
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Count If any text is entered for the third time and send Email

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 04-29-2020 at 07:52 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    04-09-2020
    Location
    Slovenia
    MS-Off Ver
    2016
    Posts
    16

    Re: Count If any text is entered for the third time and send Email

    AlphaFrog, thank you so much, it works perfectly.

    I would only need to add that if Target is Text, not number or anything else.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Count If any text is entered for the third time and send Email

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-09-2020
    Location
    Slovenia
    MS-Off Ver
    2016
    Posts
    16

    Re: Count If any text is entered for the third time and send Email

    Thanks again, but would still need your or anyone's help.

    I have many drop down lists with multiple selections and if I have a cell with two selected options - for example "Excel, Worksheet", your code doesn't recognize only "Excel".
    Do you have a solution to this?

    Characters(Start:=, Length:=) is not an option, because I have many different possibilities.
    I tried with finding the exact word/phrase, like:
    If Application.CountIf(Range("A1:T20"), "*Excel*") = 3 Then
    Call Mail_AB
    If Application.CountIf(Range("A1:T20"), "*Worksheet*") = 3 Then
    Call Mail_CD
    The problem is, that if
    A1 = Excel
    A2 = Excel
    A3 = Excel Worksheet
    everything is fine, bit if I enter any word in A4, it again calls Mail AB (because Excel is still entered three times).

    The best solution it would be, if I could add a line, that would tell excel to call a certain mail only once.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Count If any text is entered for the third time and send Email

    The cell that was changed (Target) has to contain Excel and there can only be 3 Excels total.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA to send email using data from the EXCEL including email address, subject and body text
    By ec4excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2016, 11:07 AM
  2. Replies: 1
    Last Post: 05-01-2016, 08:57 AM
  3. Send email at specific time
    By platesigns in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2014, 01:48 PM
  4. [SOLVED] Formula needed to only count total cells entered and not count adjacent text entered cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-07-2013, 06:22 PM
  5. How to send email at specified time?
    By batman07 in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2011, 01:24 PM
  6. Keep time format during send email
    By eriknokc in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-19-2009, 08:27 PM
  7. Replies: 2
    Last Post: 04-25-2009, 04:19 AM

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