+ Reply to Thread
Results 1 to 8 of 8

Function problem

  1. #1
    Registered User
    Join Date
    12-31-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    28

    Function problem

    Hello, im trying to make a function that will run same code from different labels, but keep getting an error that function or sub are not defined.

    Here is the code im trying to get to work:

    Please Login or Register  to view this content.
    The function is in a class module..
    Any ideas?

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Function problem

    try passing in me.label1 or change the arguments to be (lbl as control)
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    12-31-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Function problem

    me.Label1! gave me error: wrong number of arguemnts or invalid property assignment

    Changing lbl as control still gives the sub or function not definded :/

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Function problem

    Can you attach a sample? Is this in Access?

  5. #5
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Function problem

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-31-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Function problem

    Hi thx for trying to help, i attached a sample.
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Function problem

    Youve put the function in a class

    you need to move it to a module, or prefix with the class name.

    Google Scope to see what is going on.

  8. #8
    Registered User
    Join Date
    12-31-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Function problem

    I tried to move it to a module but still the same error

    and tried to prefix the class name Call Class1.fEvalLabel(Me![Label1])

    But didnt work either :/

+ 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. Replies: 6
    Last Post: 10-20-2013, 07:16 PM
  2. Problem Inserting Round function into an IF function
    By Ash87 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-11-2013, 05:37 PM
  3. [SOLVED] problem with 'IF' function
    By BobbyH in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-23-2012, 11:42 PM
  4. FV Function Problem
    By TerryG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  5. IF function problem
    By dvonj in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 03-10-2005, 10: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