Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Continue Quote | Setting up and Configuration of Excel | |||
to continue down in the same row | Excel Discussion (Misc queries) | |||
VB code to continue macro | Excel Discussion (Misc queries) | |||
Find a value if there continue | Excel Programming | |||
Abort or continue | Excel Programming |