+ Reply to Thread
Results 1 to 2 of 2

delete cell content if it's "#n/a"

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-06-2013
    Location
    toronto
    MS-Off Ver
    Excel 2010
    Posts
    103

    delete cell content if it's "#n/a"

    The macro has this formula:

    Range("E2").FormulaR1C1 = "=if(RC[-2]=""cad"",RC[-3],RC[-3]/vlookup(RC[-2],fx_1,3,0))"

    and the result the cell below the last row of the column returns N/A an I have manually delete its contents....

    I've tried this code to make it automated, but it doesn't work..

    For count = Range("E" & Rows.count).End(xlUp).Row To 1 Step -1
    If Range("E" & count) = "#N/A" Then Rows(count).Delete

    Any ideas?

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: delete cell content if it's "#n/a"

    Try if Range("E" & count).text = "#N/A"

    the value of the cell will be an error but the text should be the #N/A.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Delete Rows if a cell does not equal "Finished" or "Complete"
    By Justair07 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-27-2013, 12:40 PM
  2. "Form and macro" to delete "Active" cell contents.
    By wanty in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-22-2013, 11:33 PM
  3. Delete all content if username isn't "x"
    By Bishonen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-25-2012, 10:29 AM
  4. [SOLVED] Delete row if cell in Column N equal "Different" or Column P equals "Blank"
    By Cyberpawz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2012, 08:25 AM
  5. [SOLVED] Macro to delete entire row if cell contains the word "total" or "Total"
    By theatricalveggie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-10-2011, 12:38 PM

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