PC Review


Reply
Thread Tools Rate Thread

Compare blocks of cells

 
 
=?Utf-8?B?Um9taW5hbGw=?=
Guest
Posts: n/a
 
      6th Mar 2007
Is there a quick way to compare a block of cells in a row without doing
something like
a = activecell.value
B= activecell.offset(0,1).value
c = activecell.offset(0,2).value

Different worksheet.
Range(A1).activate
if activecell.value = a and activecell.offset(0,1).value = b and
activecell.offset(0,2).value = c then

'code

end if

I ask because I need to compare two worksheets and there's about 8 columns
to match and it just seems really cumbersome.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWFkaGFu?=
Guest
Posts: n/a
 
      9th Mar 2007
Hi, you need to change your strategy for comparison as follows. Write a VBA
code that does the following,
1. Loops across columns
1.1. Loops within the cells in the column
1.1.1. check if content in cell1 of worksheet1 matches the content in cell2
of worksheet2.


"Rominall" wrote:

> Is there a quick way to compare a block of cells in a row without doing
> something like
> a = activecell.value
> B= activecell.offset(0,1).value
> c = activecell.offset(0,2).value
>
> Different worksheet.
> Range(A1).activate
> if activecell.value = a and activecell.offset(0,1).value = b and
> activecell.offset(0,2).value = c then
>
> 'code
>
> end if
>
> I ask because I need to compare two worksheets and there's about 8 columns
> to match and it just seems really cumbersome.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare 1 cell to column of cells returning adjacent cells info? Mr. Fine Microsoft Excel Worksheet Functions 1 15th Apr 2010 07:36 PM
Parsing blocks of cells using VBA Gordon Filby Microsoft Excel Programming 2 6th May 2007 12:58 PM
macro needed to copy blocks of cells across to list of cells down =?Utf-8?B?cGllcnNvbnBybw==?= Microsoft Excel Programming 3 28th Mar 2007 12:51 PM
How do I compare cells and if FALSE compare to next cell in EXCEL =?Utf-8?B?Q2luZGll?= Microsoft Excel Worksheet Functions 0 24th Mar 2006 05:29 PM
Transposing blocks of cells =?Utf-8?B?RGF2ZQ==?= Microsoft Excel Programming 0 23rd Mar 2006 03:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:33 PM.