+ Reply to Thread
Results 1 to 3 of 3

finding error values with VBA code

Hybrid View

  1. #1
    Registered User
    Join Date
    03-05-2008
    Posts
    17

    finding error values with VBA code

    Hi all,

    I have a worksheet range (say a1:z500) with a lot of values in it, some of these values are errors, like # DIV /0!, # value!, etc...

    I want to write a code which replaces all these error values with smth else like "n.a."

    I assume this is a basic question, but I'm still at the early stages of learning this stuff..

    Many thanks,
    -levent

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Quote Originally Posted by levo_redkid
    Hi all,

    I have a worksheet range (say a1:z500) with a lot of values in it, some of these values are errors, like # DIV /0!, # value!, etc...

    I want to write a code which replaces all these error values with smth else like "n.a."

    I assume this is a basic question, but I'm still at the early stages of learning this stuff..

    Many thanks,
    -levent
    Hi,

    
    Sub Error_Replace()
    Dim rCell As Range
    For Each rcell In Range("A1:Z500")
        If Application.WorksheetFunction.IsError(rCell) Then
            rCell = "n/a"
        End If
    Next
    End Sub
    HTH

  3. #3
    Registered User
    Join Date
    03-05-2008
    Posts
    17
    exactly what I'm looking for. many thanks..

+ 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