LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default Allow code to continue regardless

The following code will return an error if there is nothing to return:

With ActiveSheet
With ActiveSheet
Set rng1 = Nothing
Set rng1C = Nothing
Set rng1F = Nothing
On Error Resume Next
Set rng1C = .Range("Q74:Q1000"). _
SpecialCells(xlConstants, xlNumbers)
Set rng1F = .Range("Q74:Q1000"). _
SpecialCells(xlFormulas, xlNumbers)
On Error GoTo 0
If rng1C Is Nothing Then
Set rng1 = rng1F
Else
If rng1F Is Nothing Then
Set rng1 = rng1C
Else
Set rng1 = Union(rng1F, rng1C)
End If
End If
If rng1 Is Nothing Then
MsgBox "No quantities found"
Exit Sub
End If
End With


I need the code to continue executing and ignore the nothing to return
element.
Thank you if you can help.
Pat

P.S. I have only included part of the code which I feel relevant, if more
clarity is needs I can provide 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
Continue Quote Kev Setting up and Configuration of Excel 1 August 8th 09 04:19 PM
to continue down in the same row alex178 Excel Discussion (Misc queries) 2 July 8th 06 05:34 PM
VB code to continue macro Brian Excel Discussion (Misc queries) 3 May 9th 06 03:12 AM
Find a value if there continue Tempy Excel Programming 2 May 19th 04 08:53 PM
Abort or continue Jason Gatsby Excel Programming 0 August 5th 03 02:16 AM


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