Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Program vb to do something in case of an error.


I have read the tips and googled this problem but I cannot find the
answer to it, so I am looking for your help.

My workbook is programed to copy the contents of one cell and find that
excat match in another workbook. The problem comes up when the macro
cannot find that match in the other workbook so my macro halts stating
error. How can I program my macro to ignore the error of not finding
that item and move on to the next cell.
Thanks to anyone who can help me.

Benjamin Woodruff


--
bjwoodruff
------------------------------------------------------------------------
bjwoodruff's Profile: http://www.excelforum.com/member.php...o&userid=24259
View this thread: http://www.excelforum.com/showthread...hreadid=384427

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Program vb to do something in case of an error.

show the code - what line does it error on?

tim

"bjwoodruff"
wrote in message
...

I have read the tips and googled this problem but I cannot find the
answer to it, so I am looking for your help.

My workbook is programed to copy the contents of one cell and find
that
excat match in another workbook. The problem comes up when the macro
cannot find that match in the other workbook so my macro halts
stating
error. How can I program my macro to ignore the error of not finding
that item and move on to the next cell.
Thanks to anyone who can help me.

Benjamin Woodruff


--
bjwoodruff
------------------------------------------------------------------------
bjwoodruff's Profile:
http://www.excelforum.com/member.php...o&userid=24259
View this thread:
http://www.excelforum.com/showthread...hreadid=384427



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Program vb to do something in case of an error.

One way is to set the found cell to a range variable. You can then test the
range variable to see if the contents of your original cell were found.

Something like this:

Dim FindIt As Range
'find lookup value
'switch to other sheet or set a range to test
With Cells ' check all cells or change to set range
Set FindIt = .Find("6995", LookIn:=xlValues)
End With
If Not FindIt Is Nothing Then
'Do whatever you lke with FindIt
End If

Hope this helps
Rowan

"bjwoodruff" wrote:


I have read the tips and googled this problem but I cannot find the
answer to it, so I am looking for your help.

My workbook is programed to copy the contents of one cell and find that
excat match in another workbook. The problem comes up when the macro
cannot find that match in the other workbook so my macro halts stating
error. How can I program my macro to ignore the error of not finding
that item and move on to the next cell.
Thanks to anyone who can help me.

Benjamin Woodruff


--
bjwoodruff
------------------------------------------------------------------------
bjwoodruff's Profile: http://www.excelforum.com/member.php...o&userid=24259
View this thread: http://www.excelforum.com/showthread...hreadid=384427


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
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
2 x Case // Error why ? Philipp Oberleitner Excel Programming 7 June 26th 04 02:20 PM
Case Statement error David Adamson[_3_] Excel Programming 2 June 23rd 04 05:01 AM
How to to catch embeded worksheet events in a host program (Access in my case) ? Patrice Ongla Excel Programming 0 July 27th 03 05:52 PM


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

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"