|
-
Aug 24th, 2009, 05:35 AM
#1
[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...
-
Aug 24th, 2009, 05:51 AM
#2
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:
set r = range("a1:j10") for each c in r set f = r.find(c.value) if not f is nothing then msgbox "cell " & c.address & " matches cell " & f.address 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
-
Aug 24th, 2009, 10:35 AM
#3
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
-
Aug 24th, 2009, 04:24 PM
#4
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
-
Aug 24th, 2009, 09:25 PM
#5
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.
-
Aug 24th, 2009, 10:03 PM
#6
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
-
Aug 25th, 2009, 09:37 AM
#7
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
-
Aug 25th, 2009, 04:12 PM
#8
-
Aug 25th, 2009, 09:13 PM
#9
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|