Thread: Compare Cells
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
STEVE BELL STEVE BELL is offline
external usenet poster
 
Posts: 692
Default Compare Cells

For Each Cell In Sheet1.Range("A:D").Cells
change to this
For Each Cell In Sheet1.Range("A:IV").Cells

But you better be ready to take a long break - that's a lot of cells to
check

I would consider
For Each Cell In Sheet1.UsedRange

or build code to find the Last Cell and restrict your range to A1:LastCell

dim lr as long, lc as long

lr = Sheet1.Cells.SpecialCells(xlLastCell).Row
lc= Sheet1.Cells.SpecialCells(xlLastCell).Column

For each cell in range(cells(1,1),cells(lr,lc))
--
steveB

Remove "AYN" from email to respond
"kwedde01" wrote in
message ...

Hey thanks alot for the help, by any chance if i wanted it to search
every cell on the sheet1 and every cell on sheet2, without having to
specify a certain range, how would I do that?


--
kwedde01
------------------------------------------------------------------------
kwedde01's Profile:
http://www.excelforum.com/member.php...o&userid=24156
View this thread: http://www.excelforum.com/showthread...hreadid=386563