Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to skip in a macro

Duncan,

Set an object and test it

Dim oFind As Range

Set oFind = Range("A:A").Find("Jellybean")
If Not oFind Is Nothing Then
oFind.Resize(5, 14).Copy _
Destination:=Worksheets("Totals").Range("A7")
End If

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duncan J" wrote in message
...
Hi,
I'm using this code for about 15 products:
Range("A:A").Find("Jellybean").Resize(5, 14).Copy _
Destination:=Worksheets("Totals").Range("A7")
However, sometimes Jellybean is not in the report. How do I make it skip

if it's not present in that report so the macro won't error out?

Thanks



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default How to skip in a macro

Thanks Bob
Worked like a charm.
DJ
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
MACRO COLUMNS, SKIP ROWS Dan Excel Discussion (Misc queries) 3 January 28th 10 06:13 PM
Skip a Macro Vick Excel Discussion (Misc queries) 2 December 22nd 09 05:06 PM
Macro Skip workbook [email protected] Excel Worksheet Functions 1 February 7th 08 04:24 PM
Macro Skip workbook [email protected] Excel Worksheet Functions 0 February 7th 08 03:54 PM
Sheets Skip Macro NICK Excel Discussion (Misc queries) 2 February 11th 05 07:16 AM


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