Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 15
Default Resume on Error?

Hi, I am using this code to get rid of #DIV/0 and other errors:

Range("I5:Q29").Select
Selection.SpecialCells(xlCellTypeFormulas, 16).Select
Selection.ClearContents

However, if there are no errors it stops my code from running and says
it found no cells. How can I have it say if there are none or if there
is an error from this then to skip it and just resume?

Thank you!!!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Resume on Error?

Dan,

Try

Range("I5:Q29").Select
On Error Resume Next
Selection.SpecialCells(xlCellTypeFormulas, xlErrors).Select
If Err.Number = 0 Then
Selection.ClearContents
End If

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"dan" wrote in message
ups.com...
Hi, I am using this code to get rid of #DIV/0 and other errors:

Range("I5:Q29").Select
Selection.SpecialCells(xlCellTypeFormulas, 16).Select
Selection.ClearContents

However, if there are no errors it stops my code from running
and says
it found no cells. How can I have it say if there are none or
if there
is an error from this then to skip it and just resume?

Thank you!!!



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
On Error {...} Resume Next Edd[_2_] Excel Programming 2 March 15th 06 11:09 PM
On Error Resume Next ? Nigel Excel Programming 4 August 11th 05 09:07 AM
On Error Resume Next Nigel Excel Programming 3 August 10th 05 03:34 PM
On Error Resume Next Jasper Excel Programming 4 May 12th 05 12:08 PM
On Error Resume Next D.S.[_3_] Excel Programming 1 November 28th 03 04:52 PM


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