LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Matching values in different columns/workbooks


Hi, The code below loops through each cell in one column of data and
finds the same value in another column (on another spreadsheet). This
works fine for a 100 cells, but the final version will check 600 rows
in seven worksheets, and this takes an age. How can I do this more
efficiently? Would it be better to use an array (not sure how to do
this), and I assume that when the correct value is found, the
remaining cells are still searched? Could I use a function which finds
the match and so skips checking the rest of the column?


For Each r In Workbooks("02 - Scheduler
Plan.xls").Worksheets(SchedulerDayName).Range("B2: B100").Cells
If IsNumeric(r.Value) Then
For Each c In Workbooks("00 -
MDS.xls").Worksheets(MDSDayName).Range("C4:C1000") .Cells
If c.Value = r.Value Then
c.offset(0, 2).Resize(1, 145).Copy
r.offset(0, 4).PasteSpecial xlPasteValues
End If
Next c
End If
Next r

hope you can help.

regards,
Matt
 
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
Matching Values in Two Columns John Excel Discussion (Misc queries) 2 October 27th 09 01:23 PM
Matching values in 2 columns richzip Excel Discussion (Misc queries) 1 January 24th 08 11:40 AM
Copy certain columns matching column A in two workbooks Chuckak Excel Programming 3 February 14th 07 05:28 AM
Matching values in two columns Rob Excel Discussion (Misc queries) 4 December 6th 06 04:44 AM
Matching values in 2 columns Aonghus Excel Programming 2 November 9th 05 03:31 PM


All times are GMT +1. The time now is 10:22 PM.

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

About Us

"It's about Microsoft Excel"