Results 1 to 3 of 3

Trim vba failing when #N/A in cell

Threaded View

  1. #1
    Registered User
    Join Date
    04-07-2013
    Location
    belfast
    MS-Off Ver
    Excel 2010
    Posts
    26

    Trim vba failing when #N/A in cell

    Hi

    I am having an annoying problem that I cant solve. When I use Trim(cell.value) on a cell that contains #N/A the macro stops with runtime error 13.

    The #N/A value is a result of a vlookup. All the vlookup values are copied and pastespecial. The trim is then run on these cells.

    I have On Error Resume Next built in but this only works as long as the first cell that the code tries to trim is not #N/A.
    Attachment 261742
    See attached trimerror excel file

    Any help would be welcome.
    Attached Files Attached Files
    Last edited by redmarko; 08-29-2013 at 03:29 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] IF-THEN statment failing when checking relative to a value when cell is that value
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-05-2012, 04:32 PM
  2. adding a date to cell a1 worksheet on open failing?
    By techexpressinc2 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-01-2011, 03:03 PM
  3. Cell.Formula failing with single & double variables
    By EseKuent in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2009, 02:36 AM
  4. Trying to trim a trailing space char and the Trim function isn't working
    By Psychochook in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2007, 11:28 PM
  5. [SOLVED] VBA Trim and Application.worksheetfunction.Trim
    By Hari Prasadh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2005, 11:06 AM

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