+ Reply to Thread
Results 1 to 3 of 3

Formula errors solution

Hybrid View

  1. #1
    Registered User
    Join Date
    08-21-2005
    Posts
    8

    Formula errors solution

    Dim CurrentCell As Object, NextCell As Object
    ActiveWorkbook.Sheets("Sheet1").Select
    Set CurrentCell = Range("A7")
    Do Until IsEmpty(CurrentCell)
    Set NextCell = CurrentCell.Offset(1, 0)
    CurrentCell.EntireRow.Select
    For Each CELL In Selection
    If IsError(CELL) Then
    CELL.ClearContents
    Else
    End If
    Next
    Set CurrentCell = NextCell
    Loop

  2. #2
    Bernie Deitrick
    Guest

    Re: Formula errors solution

    Ashley,

    No need to loop:

    Sub Macro1()
    On Error Resume Next
    Range("A7:IV65536").SpecialCells(xlCellTypeFormulas, 16).ClearContents
    Range("A7:IV65536").SpecialCells(xlCellTypeConstants, 16).ClearContents
    End Sub

    HTH,
    Bernie
    MS Excel MVP


    "Ashley Frank" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Dim CurrentCell As Object, NextCell As Object
    > ActiveWorkbook.Sheets("Sheet1").Select
    > Set CurrentCell = Range("A7")
    > Do Until IsEmpty(CurrentCell)
    > Set NextCell = CurrentCell.Offset(1, 0)
    > CurrentCell.EntireRow.Select
    > For Each CELL In Selection
    > If IsError(CELL) Then
    > CELL.ClearContents
    > Else
    > End If
    > Next
    > Set CurrentCell = NextCell
    > Loop
    >
    >
    > --
    > Ashley Frank
    > ------------------------------------------------------------------------
    > Ashley Frank's Profile:
    > http://www.excelforum.com/member.php...o&userid=26488
    > View this thread: http://www.excelforum.com/showthread...hreadid=397552
    >




  3. #3
    Registered User
    Join Date
    08-21-2005
    Posts
    8

    Fourmal Errors

    Bernie,

    A neat solution - far better. I only posted this I had this problem last year and thought that it may be useful

    Thanks

    ashley

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1