Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find right cell (with duplicate values)


Hi,

I have a two worksheet, both used by another user. Worksheet(1) has
data in column B and column P. Worksheet(2) is a copy of worksheet(1)
(so differences can be tracked) and the user can add rows. So the range
of rows in worksheet(2) can be larger than in worksheet(1). The data in
both columns can have duplicates. For example:
W1 Column B: W1 Column P: W2 Column B: W2 Column P:
a 1 a 4
b 2 b 3
c 5 x 8
d 4 c 4
d 1 d 5
e 7 d 2
f 2 y 1
g 5 e 6
d 6 f 9
h 8 g 7
d 4
h 2
The values in column B can be text and numbers, the values in column P
are outcomes of formulas and are allways numbers.
I create a new sheet (as resume), copy the data from worksheet(2)
column B (is the most complete one) to the new sheet and then comes the
problem.
I now have to put the values in column P from worksheet(1) at the right
place behind the right values from column B in the resume-worksheet, but
there are duplicates. The code below doesn't work, because it allways
gets the first of the duplicates.
Can someone help me change this code so it does work? Thanks in
advance!


Code:
--------------------
Sub test()

For Each cell In Sheets("Begroting WVB Won").Range("B12:B242")
myvalue = cell.Offset(0, 14).Value
Set myCell = Worksheets("Totaaloverzicht Won") _
.Range("B:B").Find(cell.Value)
myCell(1, 3).Value = myvalue
Next cell

End Sub
--------------------


--
leonidas
------------------------------------------------------------------------
leonidas's Profile: http://www.excelforum.com/member.php...o&userid=35375
View this thread: http://www.excelforum.com/showthread...hreadid=568364

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find duplicate values in an array Bony Pony[_3_] Excel Discussion (Misc queries) 8 February 15th 10 01:44 PM
MS Excel Function (Find Duplicate values) Zia New Users to Excel 3 January 8th 10 03:16 AM
how to find duplicate values in a column during enter the value? kesav Excel Discussion (Misc queries) 0 July 18th 08 06:37 AM
Find Duplicate Values and Return Another Value [email protected] Excel Worksheet Functions 2 January 18th 07 05:25 PM
Function to find duplicate values, then delete Cam Excel Worksheet Functions 1 January 27th 06 01:38 AM


All times are GMT +1. The time now is 07:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"