+ Reply to Thread
Results 1 to 5 of 5

#name error on correct formula

  1. #1
    Registered User
    Join Date
    07-26-2012
    Location
    dsf
    MS-Off Ver
    Excel 2010
    Posts
    6

    #name error on correct formula

    Hi everyone,

    I need some help with a question I bet most of you can answer. I've searched online for an answer but still haven't found it.

    So here is my question.
    I have VBA paste a formula into a cell, and it gives a #name error in Excel.
    If I just copy/paste the formula or just open it and press enter, it works, so the formula is correct.

    the formula is: =TEKST.SAMENVOEGEN(A11;B11;C11) (to put strings from different cells together)
    This is used in a row called lRow.
    the code I wrote is:

    Please Login or Register  to view this content.
    Maybe the error lies in using the lRow-variable?

    Thanks in advance and greetings
    Last edited by morphine; 07-26-2012 at 07:44 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: #name error on correct formula

    If my translation is correct, it looks ok aperture from the variable separator is a comma in the VBA and semi-colon in the function.

    You could, of course, just use: =A11 & B11 & C11 and get the same result. Easier to put into the VBA, too.

    Regards, TMS

    ---------- Post added at 10:27 AM ---------- Previous post was at 10:24 AM ----------

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    07-26-2012
    Location
    dsf
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: #name error on correct formula

    Thanks, This is way easier then trying to Past a formula with VBA.
    I feel silly for overseeing such a logical code.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: #name error on correct formula

    Just tested both formulae:

    Please Login or Register  to view this content.

    You will get a #NAME? error if the lRow variable is not defined or have a value set. If it's not defined, you'll get a compile error if you use Option Explicit.

    Regards, TMS

    ---------- Post added at 11:16 AM ---------- Previous post was at 11:14 AM ----------

    You're welcome. Thanks for the rep.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: #name error on correct formula

    I reckon you probably needed
    Please Login or Register  to view this content.
    and you'd need to use semicolons instead of commas if that's how you usually enter them
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ 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