+ Reply to Thread
Results 1 to 13 of 13

Function adding cells ignoring text cells

  1. #1
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Function adding cells ignoring text cells

    I found the following code here

    Please Login or Register  to view this content.
    I placed it in a module of PERSONAL.XLS that auto-opens hidden.
    However, it gives me #NAME? instead of the result
    Can someone help please.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor PaulSP8's Avatar
    Join Date
    11-21-2017
    Location
    Chorley, England
    MS-Off Ver
    2013 & 2021
    Posts
    437

    Re: Function adding cells ignoring text cells

    Sounds like you need to add a Reference to your Personal book.

    In the VBE go to Tools > References and make sure the name your Personal Book is included (is ticked).

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,911

    Re: Function adding cells ignoring text cells

    You need to include the workbook name if it's not an add-in:

    =Personal.xls!add_num(...)
    Rory

  4. #4
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Function adding cells ignoring text cells

    "=Personal.xls!add_num(...)"

    It now runs but...
    Attached Images Attached Images

  5. #5
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,911

    Re: Function adding cells ignoring text cells

    Add:

    Please Login or Register  to view this content.
    to the code.

  6. #6
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Function adding cells ignoring text cells

    That fixed that error, now I get this.
    How should this be defined?
    Attached Images Attached Images

  7. #7
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Function adding cells ignoring text cells

    Quote Originally Posted by PaulSP8 View Post
    Sounds like you need to add a Reference to your Personal book.

    In the VBE go to Tools > References and make sure the name your Personal Book is included (is ticked).
    I navigated to my Personal.xls, tried to add it as reference.
    That (I think) created a duplicate entry "VBAProject" in the available references. Can the dup be deleted?

    Anyway, selecting either of the "VBAProject" gives the pictured error.
    Attached Images Attached Images

  8. #8
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,911

    Re: Function adding cells ignoring text cells

    You'd have to rename the project before you can set a reference, but you don't need it set.

    Add:

    Please Login or Register  to view this content.
    to your getnumber function.

  9. #9
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Function adding cells ignoring text cells

    Yes, it works now, Thank you!

    Regarding the duplicate entry "VBAProject" in the available references, how do I delete one? How can I see the full path of the "Location"?
    What project must I rename?

    Can I add a reference to my personal.xls so that I do not have to type personal.xls!"function name"?
    Attached Images Attached Images
    Last edited by drgkt; 05-14-2019 at 03:39 AM.

  10. #10
    Valued Forum Contributor PaulSP8's Avatar
    Join Date
    11-21-2017
    Location
    Chorley, England
    MS-Off Ver
    2013 & 2021
    Posts
    437

    Re: Function adding cells ignoring text cells

    Quote Originally Posted by drgkt View Post
    Regarding the duplicate entry "VBAProject" in the available references, how do I delete one? How can I see the full path of the "Location"?
    What project must I rename?
    You don't need to delete it, just rename one.

    To rename your Personal Workbook - Open the VBE and find it in the Project Window, right click on it and select 'VBAProject Properties' - It'll open a Dialog Box where you can give it a new name.

    Once you've give it a name it should stop the conflict.

  11. #11
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,911

    Re: Function adding cells ignoring text cells

    You really don't need to rename the Personal project. If you set a reference, you will have to do that in every single workbook that you use the functions in. It is much simpler, IMO, to create an add-in with your functions in it. Once that is installed, you won't need to include the workbook name when calling the functions in it.

  12. #12
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Function adding cells ignoring text cells

    In my previous post I included a screenshot that shows the left pane of the VBE. There there is a "personal" and a "calendar" project. Is that the reason I have 2 "VBAProject" entries in the available references?
    But then again I also have a "book1" project. By the same logic I should have 3 entries on the right.

    Eitherway, Shouldn't they be already selected on the right dialog box? I do not understand.

    @rorya: How do I create that add-in. Besides, I think it defeats the purpose auto loading the personal.xls (hidden) if I have to include its name in the functions. It should work like the macros do.

  13. #13
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,911

    Re: Function adding cells ignoring text cells

    All workbooks have a project and by default they are called vbaproject so if you have book1 and your personal macro workbook open, you'll have 2 vbaproject references available.

    Just save a workbook containing the code as an add-in. You may think that's how it should work, but it doesn't so you have to work with the reality.

+ 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. Adding, then ignoring cells
    By jalevy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-05-2018, 01:56 PM
  2. Replies: 11
    Last Post: 04-04-2017, 03:49 PM
  3. Ignoring cells in an AVG function
    By OneLooseCrank in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-05-2016, 04:43 PM
  4. adding up specific cells ignoring any errors
    By barneyrubble1965 in forum Excel General
    Replies: 3
    Last Post: 12-16-2015, 07:25 AM
  5. Replies: 3
    Last Post: 09-22-2015, 03:04 PM
  6. Counting cells with text and ignoring cells with formula
    By Mad Moose in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-31-2015, 04:50 AM
  7. ignoring cells in a sum function
    By ??? in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 03-17-2008, 09:35 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