Results 1 to 9 of 9

Thread: [RESOLVED] find repeating value in a row and column

  1. #1

    Thread Starter
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Resolved [RESOLVED] find repeating value in a row and column

    hi experts
    i want to find any same value repeat in any other cells of an excel sheet using vb. for example 10 rows 10 column,
    kindly reply with some code and suggestions

    thanks
    with regards
    seenu...

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: find repeating value in a row and column

    the green tick mark generally indicates a resolved problem, in this forums

    you can try like
    vb Code:
    1. set r =  range("a1:j10")
    2. for each c in r
    3.     set f = r.find(c.value)
    4.     if not f is nothing then msgbox "cell " & c.address & " matches cell " & f.address
    5. next
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: find repeating value in a row and column

    hi westconn
    thanks for ur reply, i cant understand it well, if posible pls post a simple project in excel, which find the repeated value with in a range of cells

    thanks

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: find repeating value in a row and column

    put a command button or something, copy that code to work when the button is clicked

    change the range to your 10x10 of data
    run it and see what happens
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5

    Thread Starter
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: find repeating value in a row and column

    yes i did as u told, but it shows all the cells in the msgbox one by one even the value not repeating, like this "cell $A$1 matches cell $A$1" upto the last cell of range(A1 to J10), that means the msgbox shown (10X10=100) times.

  6. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: find repeating value in a row and column

    oops, try changing line 3 to
    set f = r.find(c.value, c)
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  7. #7

    Thread Starter
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: find repeating value in a row and column

    sory, resulting the same even after change the code, i think i hav to check the value by row and column then only i can get all the repeating values, i try my best, if u hav any idea pls tel me

  8. #8
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: find repeating value in a row and column

    I thought this thread is resolved

    Ok

    Here is a quick sample... little complex but works just fine...

    Hope this is what you wanted?
    Attached Files Attached Files
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  9. #9

    Thread Starter
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: find repeating value in a row and column

    thanks kool
    yes it is little complex but works fine

Posting Permissions

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



Click Here to Expand Forum to Full Width