+ Reply to Thread
Results 1 to 12 of 12

macro giving #N/A error

  1. #1
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Post macro giving #N/A error

    dear friends here i have attached my document.i have inset 3 macros to my document.in that one macro answer is 50% only working.macro name is "FINAL".if u click "FINAL" macro button that macro first sheet column "A,B,C" match with second sheet column "B,D,C" & values giving in first sheet column "F,G,H,I".in that some values giving #N/A error.pls help me i can't understand what's wrong with this....pls help.....
    document password - 0
    Attached Files Attached Files
    Last edited by johncena; 05-31-2010 at 08:15 AM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: macro giving #N/A error

    Hi johncena

    Ignore this, my mistake, and I can't delete the post

    Sorry
    Last edited by Marcol; 05-31-2010 at 07:42 AM.

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: macro giving #N/A error

    Your data in Processing!D4 has a trailing space.

    Therefore the lookup fails.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro giving #N/A error

    it's ok Marcol u have help me a lot in my previous posts.

  5. #5
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro giving #N/A error

    Quote Originally Posted by Andy Pope View Post
    Your data in Processing!D4 has a trailing space.

    Therefore the lookup fails.
    not clear for me sir,what i can do for this,,,,,,

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: macro giving #N/A error

    remove the trailing space from the cell.

    In a spare column you could use the formula =TRIM(D4)
    then copy+paste special values back over D4.

  7. #7
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro giving #N/A error

    Quote Originally Posted by Andy Pope View Post
    remove the trailing space from the cell.

    In a spare column you could use the formula =TRIM(D4)
    then copy+paste special values back over D4.
    wow thanks a lot sir it's work.REP+

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: macro giving #N/A error

    Well spotted Andy

    Johncena

    In a spare cell in row 4 say AA4

    =TRIM(D4)
    fill down as far as you need say in this case row 400

    Copy AA4:AA400

    Select Cell D4

    PasteSpecial > values

    Column AA Clear all

    This will give you a temporary fix and proove your formulae

    Best to fix this problem at source now you know where it comes from.

    Cheers

    EDIT
    To late AGAIN
    Why do I never see replies when I refresh my browser!!!
    Last edited by Marcol; 05-31-2010 at 08:26 AM. Reason: Browser not refreshing properly.

  9. #9
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Post Re: macro giving #N/A error

    dear marco i have try this macro & it's given correct answer for me.thanks lot again.....
    Please Login or Register  to view this content.

  10. #10
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: macro giving #N/A error

    As an after thought

    The TRIM() formula in Excel will remove leading, trailing and any extra spaces

    The Trim() formula in VBa only removes leading & trailing spaces

    This might be worth watching if you use VBa to correct column D
    There might be mismatches where accidental spaces have been added at source.

    Cheers
    Alistair

  11. #11
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: macro giving #N/A error

    In view of the above it might be better to use

    Please Login or Register  to view this content.
    Hope this helps

  12. #12
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro giving #N/A error

    thanks for your macro Marcol.REP+

+ 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