Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Compare blocks of cells

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Compare blocks of cells

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
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
Copying Blocks of Cells [email protected] Excel Discussion (Misc queries) 1 March 4th 09 11:54 AM
SUMIFs for particular cells in blocks of data [email protected] Excel Worksheet Functions 2 August 22nd 08 11:42 PM
Stop selecting blocks of cells Legallisa - switching from WordPerfect New Users to Excel 2 June 10th 08 03:04 AM
Transposing blocks of cells Dave Excel Programming 0 March 23rd 06 03:58 PM
parsing blocks of cells for charts [email protected] Excel Programming 2 February 26th 06 05:53 PM


All times are GMT +1. The time now is 10:25 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"