LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 361
Default Find function bypass

I have a macro that requires copying and pasting data from a pivot table in
to another workbook. I need to copy data in certain cells whenever there is
data available. So some months certain products will not have any data so
the pivot table will not even show them.

I have written some script in to a macro so that once the macro has chosen
the correct pivot table variables it then searches for the product. When it
finds the product it goes to the last cell in the row with data in it and
copies and pastes it in to the other work book. The problem is that when it
searches for something not there it stops the macro.

How do I write allow for times when excel cannot find the data and returns
the cannot find message? Basically, I want the macro to run normally when it
can find it but when it can't I want it to move on to the next search. So
this would be the normal script:

Cells.Find(What:="Toys", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Select
Selection.End(xlToRight).Select

Is there something I can put after the Cells.Find bit that allows it to
ignore the rest of the script and move on to the next search if it can't find
it?
 
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
Bypass a function in a Macro bevchapman Excel Discussion (Misc queries) 3 October 6th 09 04:07 PM
how to bypass password?? funkymonkUK[_182_] Excel Programming 3 June 15th 06 10:46 PM
Bypass Worksheet_Change Sub Matt Excel Programming 3 February 21st 06 09:57 PM
Bypass an Ken Loomis Excel Programming 4 July 3rd 05 04:34 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


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