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: 1
Default Compare values in 2 worksheets


Hi everyone!
We need to match records between 2 worksheets using column "K" in both
sheets. It contains a unique item number for each record (like a
database)

Using a loop, if the active cell in column D of worksheet1 is blank,
then the value in column D in worksheet2 is printed to the cell in
worksheet1 where the cell in column K are the same in both worksheets.

Dim i As Long

For i = 7 To lastRow
If Cells(i, "D").Value = "" And Cells(i, "K").Value = 'Value in
column "K" of worksheet2 Then
Cells(i, "D").Value = 'Value from the cell in column "D" of
worksheet2
End If
Next i

Thanks in advance everyone!


--
mthomas
------------------------------------------------------------------------
mthomas's Profile: http://www.excelforum.com/member.php...o&userid=25649
View this thread: http://www.excelforum.com/showthread...hreadid=467564

 
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
how to compare/sort values in two columns of two worksheets? pemt Excel Discussion (Misc queries) 4 January 21st 09 10:22 PM
Excel VBA Macro to compare 2 worksheets for same values [email protected] Excel Worksheet Functions 0 August 23rd 06 04:35 PM
Code to compare cell values from different worksheets Ed P[_2_] Excel Programming 1 February 18th 05 03:26 PM
How do i compare values from two sheet and copy & paste if values match? rozb Excel Programming 0 March 5th 04 12:06 AM


All times are GMT +1. The time now is 01:24 AM.

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"