+ Reply to Thread
Results 1 to 18 of 18

Speak if duplicate value is found in 3 cells

  1. #1
    Forum Contributor
    Join Date
    11-08-2017
    Location
    London
    MS-Off Ver
    Office 2007
    Posts
    122

    Speak if duplicate value is found in 3 cells

    Easy one but I need some help. Got the following code to check for a duplicate on 3 cells in 1 row only for a duplicate value but its not working. In the example 4 0 4 have a duplicate. It should also check for 4 4 0 so on all 3 cells Any help appreciated and rep given for a sollution

    Thanks

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Speak if duplicate value is found in 3 cells

    .
    Please Login or Register  to view this content.
    You had 3 to Lastrow .... should have been 2 to Lastrow

  3. #3
    Forum Contributor
    Join Date
    11-08-2017
    Location
    London
    MS-Off Ver
    Office 2007
    Posts
    122

    Re: Speak if duplicate value is found in 3 cells

    Quote Originally Posted by Logit View Post
    .
    Please Login or Register  to view this content.
    You had 3 to Lastrow .... should have been 2 to Lastrow
    Thank you fixed that but its not working still......changed the 404 to 410 so no duplicate but if I run macro it speaks.....I want the macro to only speak on a duplicate value.Hope someone can assist
    Please Login or Register  to view this content.

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Speak if duplicate value is found in 3 cells

    Hello JohnGreen2,

    Please try:

    Please Login or Register  to view this content.
    Regards.
    Last edited by Winon; 04-10-2018 at 06:02 PM.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Speak if duplicate value is found in 3 cells

    .
    Using your original macro, this edit will work :

    Please Login or Register  to view this content.
    Hey Winon !

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Speak if duplicate value is found in 3 cells

    Hey Logit,

    Six of the one, half a dozen of the other!

    But this revised Code won't limit the Code to Row 2 only.

    Please Login or Register  to view this content.
    And

    Please Login or Register  to view this content.
    Regards.
    Attached Files Attached Files

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Speak if duplicate value is found in 3 cells

    .
    You right !


  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Speak if duplicate value is found in 3 cells

    Thanks Buddy,

    But my Code and sample workbook is incorrect.

    It needs some serious rethinking.

    Regards.
    Last edited by Winon; 04-10-2018 at 07:33 PM.

  9. #9
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Speak if duplicate value is found in 3 cells

    @ Logit,

    I would like to think that this is what, JohnGreen2 is looking for.

    I have employed Cell T2 as a "Helper Cell", which of course could be changed to suit.

    Please Login or Register  to view this content.
    Regards.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    11-08-2017
    Location
    London
    MS-Off Ver
    Office 2007
    Posts
    122

    Re: Speak if duplicate value is found in 3 cells

    Winon and Logit some fantastic coding skills thank you very much I am testing quickly -Rep for you both.......testing and will come close the thread thank you GURUS

    P.S I only want to check for a duplicate on that one line only....well spotted Winon

  11. #11
    Forum Contributor
    Join Date
    11-08-2017
    Location
    London
    MS-Off Ver
    Office 2007
    Posts
    122

    Re: Speak if duplicate value is found in 3 cells

    Quote Originally Posted by Winon View Post
    Hello JohnGreen2,

    Please try:

    Please Login or Register  to view this content.
    Regards.
    This one works PERFECTLY as only on 1 line Thank you Winon.

  12. #12
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Speak if duplicate value is found in 3 cells

    .
    You are welcome. For one row (line), Post #5 will work.

  13. #13
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Speak if duplicate value is found in 3 cells

    Thank you for the feedback, JohnGreen2,

    You are welcome, and thank you for the Rep+, much appreciated!

    Glad we could help.

    @ Logit,

    And if the line has to move down a Row or Two, to free up some space at the top? Then your Code will have to be adjusted accordingly. Please don't get smart with me, and ask me, what if the Columns have to be moved for whatever reason/s.O.K.! If you do that I'll clap you flat!

    'Twas nice working with you on this one.

    Thx Buddy.


    Regards.

  14. #14
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Speak if duplicate value is found in 3 cells

    Just to get under your skin, Tjaart.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  15. #15
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Speak if duplicate value is found in 3 cells

    .
    Winon

    Have you been taking your medication like you are supposed to ?

  16. #16
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Speak if duplicate value is found in 3 cells

    Hello bakerman2,

    Yeah, you are correct. If I was 100% certain than the Code would apply to only one Row, I would have used your approach, since scripting.dictionary cannot contain duplicates!

    @ Logit,

    You are cruising for a bruising mate.


    See ya guys.

  17. #17
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this !


    Another way :

    PHP Code: 
    Sub Demo1()
        For 
    R& = 2 To Split(Sheet1.UsedRange.Address"$")(4)
            If 
    Sheet1.Evaluate(Replace("COUNTIF(O#:Q#,O#)+COUNTIF(O#:Q#,P#)""#"R)) > 2 Then _
               Application
    .Speech.Speak "Duplicate value in row #" R
        Next
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  18. #18
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Speak if duplicate value is found in 3 cells

    Hello Marc L,

    Yes that is good.

    The only thing is that if Option Explicit at the Beginning of the Code, it should be as follow;

    Please Login or Register  to view this content.
    Then it will run without any problems.

    Regards.

+ 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. Speak cells
    By thong127 in forum Excel General
    Replies: 5
    Last Post: 11-22-2017, 05:06 PM
  2. Speak - Speech - Speak numbers individually
    By BDD2015 in forum Excel General
    Replies: 8
    Last Post: 03-23-2017, 08:32 PM
  3. Message box if duplicate found and clear the data from corresponding cells
    By sahal in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-01-2015, 06:00 AM
  4. Clear multiple cells in a row if duplicate is found
    By gokica in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-18-2014, 06:35 PM
  5. Speak a range of cells every minute automatically
    By Sarangsood in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-11-2013, 12:39 AM
  6. Speak cells when the condition is met.
    By Sarangsood in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2012, 03:10 AM
  7. Highlight cells if duplicate found on the same row
    By martinez_pedro in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-23-2010, 04:24 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