View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Abe[_4_] Abe[_4_] is offline
external usenet poster
 
Posts: 24
Default specialcells and error question

I removed the colon, but it still gives me an error.

Anything else? Maybe a different way to check for empty cells?

Thanks again Tom,

-Abe

Tom Ogilvy wrote:
Yes it should. Try removing the colon in the on error goto statement. Just
use

On Error GoTo nothingIncol2
' specialcells code.
On Error goto 0


Exit sub
NothingIncol2:
msgbox "None found
End sub

--
Regards,
Tom Ogilvy

"Abe" wrote:

I have the following code, where I want to set rnge to all the cells in
column two that have values in them.

Dim rnge as Range
On Error GoTo nothingIncol2:
Set rnge =
Worksheets("SaveLoad").Range("B:B").SpecialCells(x lCellTypeConstants)
On Error GoTo 0

However, if there is nothing in the B column, it returns a Run-time
error: "No Cells where found".

Shouldn't the error GoTo catch this?

Thanks,

-Abe