Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Compare cell values on different worksheets

Hello,
I´m a newbie to excel VBA programming trying to automate a huge task
that is currently being done by hand.

I have two worksheets with products that I need to compare.
Each product has a code and a product name in the following format:
Column A has the product code and column B the product name,for
example:

ColumnA ColumnD
AM1BL15X AGLO MEL BLANCO 1C 15MM 215X244

Both sheets *should* have the same data in them but there are 4000
products that need to have their description verified.So I need to go
down each row on Sheet1 , extract the product code from
Sheet1.ColumnA and the product name from Sheet1.ColumnD. Then do a
search on Sheet2 for the product code (Sheet2.ColumnA) and verify that
the product description on sheet2 (Sheet2.ColumnD) is the same as in
Sheet1.ColumnD. If it matches,everything is OK. If not there is
something wrong. So I´m thinking that maybe the product codes that
dont have matching descriptions could be entered in to a separate
worksheet so that someone can check it later.

I´ve been reading around and found these code samples from this group
( http://tinyurl.com/yuq7eq ):
Dim rng1 as Range, i as Long
Dim cell as Range
With worksheet("Sheet1")
set rng1 = .Range(.Cells(1,1),.Cells(1,1).End(xldown))
End With

i = 0
for each cell in rng1


if cell.Value < worksheets("Sheet2") .Range("A1").Offset(i,0).Value
Then
' do what - they don't match
else
' do what - they match
End if
i = i + 1
Next


I´ve been trying to make some changes but I dont quite know how to do
the actual code search on Sheet2 to compare the descriptions.

If someone has any code snippets to give me a hand I would be very
grateful.
Thanks!
Rafael

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
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
Compare values in 2 worksheets mthomas[_15_] Excel Programming 2 September 15th 05 07:01 PM
Code to compare cell values from different worksheets Ed P[_2_] Excel Programming 1 February 18th 05 03:26 PM


All times are GMT +1. The time now is 08:31 AM.

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"