Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Finding cell matches

Hi, I got the Cells.Find line by recording the Macro so I don't really
understand how the code works. Basically I'm just copying a cell from
one spreadsheet and going to the other and trying to find it in there.
It's working fine when it's able to find a matching cell, but it comes
up with an error when it doesn't. All I want is to be able to stop it
when it doesn't come up with a match without the error message. Any
suggestions? Thanks ahead of time for the help.

Selection.Copy
x = ActiveCell
Windows("VOD Master List as of 06-19-07.xls").Activate
Cells.Find(What:=x, After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Finding cell matches

Maybe:

On Error Resume Next ' switch off error check
Cells.Find(What:=x, After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
On Error Goto 0 ' switch on error check

Regards

Trevor


wrote in message
ups.com...
Hi, I got the Cells.Find line by recording the Macro so I don't really
understand how the code works. Basically I'm just copying a cell from
one spreadsheet and going to the other and trying to find it in there.
It's working fine when it's able to find a matching cell, but it comes
up with an error when it doesn't. All I want is to be able to stop it
when it doesn't come up with a match without the error message. Any
suggestions? Thanks ahead of time for the help.

Selection.Copy
x = ActiveCell
Windows("VOD Master List as of 06-19-07.xls").Activate
Cells.Find(What:=x, After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate



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
Finding matches in two columns Erik Excel Worksheet Functions 4 April 26th 10 03:32 AM
Finding the cell loacation that matches a specific value in a rang Zuo Excel Worksheet Functions 3 February 24th 10 10:09 PM
Finding subsequent matches Ker_01 Excel Worksheet Functions 5 April 1st 08 07:00 PM
Finding matches ( GARY Excel Discussion (Misc queries) 1 October 9th 07 02:35 PM


All times are GMT +1. The time now is 03:49 PM.

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"